Author: tkreuzer
Date: Wed Feb 13 02:14:07 2008
New Revision: 32335
URL:
http://svn.reactos.org/svn/reactos?rev=32335&view=rev
Log:
BITMAPOBJ_CopyBitmap:
- release lock on failure
- delete created bitmap on failure
- copy flags, fixes a memory leak
Modified:
trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c Wed Feb 13 02:14:07 2008
@@ -664,12 +664,20 @@
if (buf == NULL)
{
GDIOBJ_UnlockObjByPtr(GdiHandleTable, resBitmap);
+ GDIOBJ_UnlockObjByPtr(GdiHandleTable, Bitmap);
+ NtGdiDeleteObject(res);
return 0;
}
IntGetBitmapBits (Bitmap, bm.bmWidthBytes * abs(bm.bmHeight), buf);
IntSetBitmapBits (resBitmap, bm.bmWidthBytes * abs(bm.bmHeight), buf);
ExFreePool (buf);
+ resBitmap->flFlags = Bitmap->flFlags;
GDIOBJ_UnlockObjByPtr(GdiHandleTable, resBitmap);
+ }
+ else
+ {
+ NtGdiDeleteObject(res);
+ res = NULL;
}
}