File emfdc.c, function get_bitmap_info: Memory leaks in get_bitmap_info via return before calling DeleteDC and DeleteObject.
-- v17: gdi32: Actually return the device context and bitmap from get_bitmap_info().
From: AlexeyLushnikov lexa_64@mail.ru
--- dlls/gdi32/emfdc.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/gdi32/emfdc.c b/dlls/gdi32/emfdc.c index d81374a073e..e48da848a96 100644 --- a/dlls/gdi32/emfdc.c +++ b/dlls/gdi32/emfdc.c @@ -165,8 +165,8 @@ static UINT get_bitmap_info( HDC *hdc, HBITMAP *bitmap, BITMAPINFO *info )
if (info_size == sizeof(dib)) { - blit_dc = *hdc; - blit_bitmap = *bitmap; + if (!GetDIBits( *hdc, *bitmap, 0, INT_MAX, NULL, info, DIB_RGB_COLORS )) + return 0; } else { @@ -214,9 +214,11 @@ static UINT get_bitmap_info( HDC *hdc, HBITMAP *bitmap, BITMAPINFO *info ) if (!SelectObject( blit_dc, blit_bitmap )) goto err; if (!BitBlt( blit_dc, 0, 0, bmp.bmWidth, bmp.bmHeight, *hdc, 0, 0, SRCCOPY )) goto err; + if (!GetDIBits( blit_dc, blit_bitmap, 0, INT_MAX, NULL, info, DIB_RGB_COLORS )) + goto err; + *hdc = blit_dc; + *bitmap = blit_bitmap; } - if (!GetDIBits( blit_dc, blit_bitmap, 0, INT_MAX, NULL, info, DIB_RGB_COLORS )) - goto err;
bpp = info->bmiHeader.biBitCount; if (bpp <= 8) @@ -227,8 +229,8 @@ static UINT get_bitmap_info( HDC *hdc, HBITMAP *bitmap, BITMAPINFO *info ) return sizeof(BITMAPINFOHEADER);
err: - if (blit_dc && blit_dc != *hdc) DeleteDC( blit_dc ); - if (blit_bitmap && blit_bitmap != *bitmap) DeleteObject( blit_bitmap ); + DeleteDC( blit_dc ); + if (blit_bitmap) DeleteObject( blit_bitmap ); return 0; }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=148462
Your paranoid android.
=== debian11b (64 bit WoW report) ===
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000011A00DC, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032
Fixed up some white-space and removed a merge commit.
This merge request was approved by Huw Davies.