xcbgrab: Check av_strdup() allocation
authorVittorio Giovara <vittorio.giovara@gmail.com>
Wed, 11 Mar 2015 19:25:01 +0000 (19:25 +0000)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Thu, 12 Mar 2015 15:29:59 +0000 (15:29 +0000)
Bug-Id: CID 1274038

libavdevice/xcbgrab.c

index 20a29d1..2435c9c 100644 (file)
@@ -602,6 +602,8 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s)
     if (opts) {
         sscanf(opts, "%d,%d", &c->x, &c->y);
         host = av_strdup(s->filename);
+        if (!host)
+            return AVERROR(ENOMEM);
         host[opts - s->filename] = '\0';
     }