Browse Source

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>
tags/n2.4
rogerdpack Michael Niedermayer 11 years ago
parent
commit
ea97859c8c
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libavdevice/gdigrab.c

+ 6
- 0
libavdevice/gdigrab.c View File

@@ -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 {


Loading…
Cancel
Save