rhett-lee / nim_duilib

duilib界面库的改进版,支持Windows/Linux平台(基于SDL3),支持Skia渲染引擎(支持CPU/GPU),支持DPI感知,多语言动态切换,支持SVG,PNG,GIF,JPG,BMP,APNG,WEBP,ICO图片,支持GIF/WebP/APNG动画。
MIT License
69 stars 15 forks source link

When using the colorpicker to pick a color from the screen, the program crashes #28

Closed mandomwu closed 3 months ago

mandomwu commented 3 months ago

1.Problem Description When running controls.exe, the colorpicker window opens; the program crashes。 The vs2019 debug output window displays the following error message

HEAP CORRUPTION DETECTED: after Normal block (#706823) at 0x08A84EB0.
CRT detected that the application wrote to memory after end of heap buffer.

crash

2.Cause of the bug In the GetMousePosBitmap function of the ColorPicker.cpp file, pDestPixelBits[++destColorIndex] = pPixelBits[colorXY]; the access subscript of ++destColorIndex starts at 1, so pDestPixelBits will be written out of bounds; it crashes when released; the problem is solved after changing to pDestPixelBits[destColorIndex++] = pPixelBits[colorXY];

rhett-lee commented 3 months ago

这个缺陷已经修复。