summaryrefslogtreecommitdiff
path: root/libavdevice/xcbgrab.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-09 01:54:51 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-12-09 01:54:51 +0100
commite86df0206f06b8d1e97e2b60db8f74a398d53127 (patch)
tree750c82f61efd8cedb4f17217a285305e90967946 /libavdevice/xcbgrab.c
parent754f4957d7a7e5be0df0e9de1d31aebeecdc4476 (diff)
avdevice/xcbgrab: check xcb_query_pointer_reply_t pointer before use
Fixes CID1254668 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/xcbgrab.c')
-rw-r--r--libavdevice/xcbgrab.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavdevice/xcbgrab.c b/libavdevice/xcbgrab.c
index f2b913508a..ca85186087 100644
--- a/libavdevice/xcbgrab.c
+++ b/libavdevice/xcbgrab.c
@@ -106,12 +106,17 @@ static int xcbgrab_reposition(AVFormatContext *s,
xcb_get_geometry_reply_t *geo)
{
XCBGrabContext *c = s->priv_data;
- int x = c->x, y = c->y, p_x = p->win_x, p_y = p->win_y;
+ int x, y, p_x, p_y;
int w = c->width, h = c->height, f = c->follow_mouse;
if (!p || !geo)
return AVERROR(EIO);
+ x = c->x;
+ y = c->y;
+ p_x = p->win_x;
+ p_y = p->win_y;
+
if (f == FOLLOW_CENTER) {
x = p_x - w / 2;
y = p_y - h / 2;