aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrogerdpack <rogerpack2005@gmail.com>2014-08-19 07:42:18 -0600
committerMichael Niedermayer <michaelni@gmx.at>2014-08-19 16:07:28 +0200
commitea97859c8c218b83ab747a7eabcb88ca446f6751 (patch)
tree29b5fabbc400673a90db3ab8378f19fb844d09d1
parent9a07c15f4893a014ea5f154196a78735f2cb1d24 (diff)
downloadffmpeg-ea97859c8c218b83ab747a7eabcb88ca446f6751.tar.gz
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>
-rw-r--r--libavdevice/gdigrab.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavdevice/gdigrab.c b/libavdevice/gdigrab.c
index bccfef2c87..9a185d4c79 100644
--- a/libavdevice/gdigrab.c
+++ b/libavdevice/gdigrab.c
@@ -440,6 +440,8 @@ static void paint_mouse_pointer(AVFormatContext *s1, struct gdigrab *gdigrab)
POINT pos;
RECT clip_rect = gdigrab->clip_rect;
HWND hwnd = gdigrab->hwnd;
+ info.hbmMask = NULL;
+ info.hbmColor = NULL;
if (ci.flags != CURSOR_SHOWING)
return;
@@ -481,6 +483,10 @@ static void paint_mouse_pointer(AVFormatContext *s1, struct gdigrab *gdigrab)
}
icon_error:
+ if (info.hbmMask)
+ DeleteObject(info.hbmMask);
+ if (info.hbmColor)
+ DeleteObject(info.hbmColor);
if (icon)
DestroyCursor(icon);
} else {