Commit ff752456 authored by Evan Stade's avatar Evan Stade Committed by Alexandre Julliard

gdiplus: Better error checking in GdipBitmapLockBits.

parent 96a69f05
......@@ -142,9 +142,10 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect,
stride = (stride + 3) & ~3;
buff = GdipAlloc(stride * abs_height);
if(!buff) return OutOfMemory;
bmi.bmiHeader.biBitCount = bitspp;
if(buff)
GetDIBits(hdc, (HBITMAP)hbm, 0, abs_height, buff, &bmi, DIB_RGB_COLORS);
if(!bm_is_selected){
......@@ -152,6 +153,9 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect,
DeleteDC(hdc);
}
if(!buff)
return OutOfMemory;
lockeddata->Width = rect->Width;
lockeddata->Height = rect->Height;
lockeddata->PixelFormat = format;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment