diff --git a/win32ss/gdi/gdi32/objects/bitmap.c b/win32ss/gdi/gdi32/objects/bitmap.c index 438521f69e9..b6946d63337 100644 --- a/win32ss/gdi/gdi32/objects/bitmap.c +++ b/win32ss/gdi/gdi32/objects/bitmap.c @@ -729,6 +729,11 @@ SetDIBitsToDevice( ScanLines = pConvertedInfo->bmiHeader.biHeight; } + /* The caller might be sending "just enough" data. Setting ScanLines as Height */ + if (ScanLines != Height) + { + ScanLines = Height; + } cjBmpScanSize = DIB_BitmapMaxBitsSize((LPBITMAPINFO) lpbmi, ScanLines); pvSafeBits = RtlAllocateHeap(GetProcessHeap(), 0, cjBmpScanSize); @@ -742,7 +747,7 @@ SetDIBitsToDevice( { Hit = TRUE; } - _SEH2_END + _SEH2_END; if (Hit) {