In Methode TLMDPNGChunkIHDR.PrepareImageData
The line
ImageHandle := CreateDIBSection(ImageDC, pBitmapInfo(@BitmapInfo)^, DIB_RGB_COLORS, ImageData, 0, 0);
could get a 0-Handle an Null-Pointer on ImageData if the drawing is very big.
I add following line
if ImageHandle = 0 then
RaiseLastOSError;
the get a better error message instead of a access violation.
Comments
Replace
GetMem(fMemory, Size * SIZEOF(Pointer))
with
fMemory := AllocMem(Size * SIZEOF(Pointer))