]> git.sesse.net Git - ffmpeg/commitdiff
x11grab: Check XFixesGetCursorImage return value
authorLuca Barbato <lu_zero@gentoo.org>
Thu, 11 Sep 2014 12:28:44 +0000 (14:28 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Sat, 4 Oct 2014 21:46:46 +0000 (23:46 +0200)
It could return NULL if the cursor is outside the screen, the connection
timed out or the system is out of memory.

CC: libav-stable@libav.org
libavdevice/x11grab.c

index ebc893bc8a5b5dc608eec7fb3c07577ba1613f05..1f91be9f2922e3b7d647db264b9bb604dc7eeced 100644 (file)
@@ -392,6 +392,8 @@ static void paint_mouse_pointer(XImage *image, X11GrabContext *s)
         return;
 
     xcim = XFixesGetCursorImage(dpy);
+    if (!xcim)
+        return;
 
     x = xcim->x - xcim->xhot;
     y = xcim->y - xcim->yhot;