Module: wine Branch: master Commit: ce552d4451ffecbb3c61eeb3982541a56872bae3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ce552d4451ffecbb3c61eeb398...
Author: Lei Zhang thestig@google.com Date: Fri Jul 18 15:28:44 2008 -0700
gdi32: CreateDIBitmap should check for SetDIBits failure.
---
dlls/gdi32/dib.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index 677cda5..440857d 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -1118,7 +1118,14 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header,
if (handle) { - if (init == CBM_INIT) SetDIBits( hdc, handle, 0, height, bits, data, coloruse ); + if (init == CBM_INIT) + { + if (SetDIBits( hdc, handle, 0, height, bits, data, coloruse ) == 0) + { + DeleteObject( handle ); + handle = 0; + } + }
else if (hdc && ((dc = get_dc_ptr( hdc )) != NULL) ) {