Merge commit '65e78a2e4b111627c0ebdf2c9baec95e5e21560d'
[ffmpeg.git] / libavdevice / gdigrab.c
index bccfef2..9a185d4 100644 (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;
         POINT pos;
         RECT clip_rect = gdigrab->clip_rect;
         HWND hwnd = gdigrab->hwnd;
+        info.hbmMask = NULL;
+        info.hbmColor = NULL;
 
         if (ci.flags != CURSOR_SHOWING)
             return;
 
         if (ci.flags != CURSOR_SHOWING)
             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)
             DestroyCursor(icon);
     } else {
         if (icon)
             DestroyCursor(icon);
     } else {