[FFmpeg-cvslog] x11grab: Check XFixesGetCursorImage return value

Luca Barbato git at videolan.org
Sun Oct 5 03:32:12 CEST 2014


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Thu Sep 11 14:28:44 2014 +0200| [5b9c817dc7577b6d44acc94d73b9c77c52cda489] | committer: Luca Barbato

x11grab: Check XFixesGetCursorImage return value

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 at libav.org

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5b9c817dc7577b6d44acc94d73b9c77c52cda489
---

 libavdevice/x11grab.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index ebc893b..1f91be9 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -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;



More information about the ffmpeg-cvslog mailing list