mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-18 04:47:12 +00:00
gdigrab: fix gdi object leak if using mouse
based on patch from hlszl1983@163.com Signed-off-by: rogerdpack <rogerpack2005@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
9a07c15f48
commit
ea97859c8c
@ -440,6 +440,8 @@ static void paint_mouse_pointer(AVFormatContext *s1, struct gdigrab *gdigrab)
|
|||||||
POINT pos;
|
POINT pos;
|
||||||
RECT clip_rect = gdigrab->clip_rect;
|
RECT clip_rect = gdigrab->clip_rect;
|
||||||
HWND hwnd = gdigrab->hwnd;
|
HWND hwnd = gdigrab->hwnd;
|
||||||
|
info.hbmMask = NULL;
|
||||||
|
info.hbmColor = NULL;
|
||||||
|
|
||||||
if (ci.flags != CURSOR_SHOWING)
|
if (ci.flags != CURSOR_SHOWING)
|
||||||
return;
|
return;
|
||||||
@ -481,6 +483,10 @@ static void paint_mouse_pointer(AVFormatContext *s1, struct gdigrab *gdigrab)
|
|||||||
}
|
}
|
||||||
|
|
||||||
icon_error:
|
icon_error:
|
||||||
|
if (info.hbmMask)
|
||||||
|
DeleteObject(info.hbmMask);
|
||||||
|
if (info.hbmColor)
|
||||||
|
DeleteObject(info.hbmColor);
|
||||||
if (icon)
|
if (icon)
|
||||||
DestroyCursor(icon);
|
DestroyCursor(icon);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user