File emfdc.c, function get_bitmap_info: Memory leaks in get_bitmap_info via return before calling DeleteDC and DeleteObject.
-- v8: gdi32: Actually return the device context and bitmap from get_bitmap_info().
From: AlexeyLushnikov lexa_64@mail.ru
--- dlls/gdi32/emfdc.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/gdi32/emfdc.c b/dlls/gdi32/emfdc.c index d81374a073e..eeacfdbe0c4 100644 --- a/dlls/gdi32/emfdc.c +++ b/dlls/gdi32/emfdc.c @@ -214,6 +214,9 @@ 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; + + *hdc = blit_dc; + *bitmap = blit_bitmap; } if (!GetDIBits( blit_dc, blit_bitmap, 0, INT_MAX, NULL, info, DIB_RGB_COLORS )) goto err;
From: AlexeyLushnikov lexa_64@mail.ru
On Tue Sep 10 08:30:18 2024 +0000, Huw Davies wrote:
Could you please update the commit message? Something like: `gdi32: Actually return the device context and bitmap from get_bitmap_info().`
Done. Is it correct?
On Tue Sep 10 08:30:18 2024 +0000, AlexeyLushnikov wrote:
Done. Is it correct?
Unfortunately not, you now have two commits on the MR (as can be seen [here](https://gitlab.winehq.org/wine/wine/-/merge_requests/6453))