[PATCH v8 0/2] MR6453: emfdc: avoid memory leaks in get_bitmap_info
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(). https://gitlab.winehq.org/wine/wine/-/merge_requests/6453
From: AlexeyLushnikov <lexa_64(a)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; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6453
From: AlexeyLushnikov <lexa_64(a)mail.ru> -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6453
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?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6453#note_81733
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))
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6453#note_81735
participants (3)
-
AlexeyLushnikov -
AlexeyLushnikov (@AlexeyLushnikov) -
Huw Davies (@huw)