aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-03-11 19:25:01 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-03-12 15:29:59 +0000
commitedca1dd552efa1ebef016ca9eff4ce6757605819 (patch)
tree055caadafd5274d1a1910b767b97d74af9d25fd1
parent17c45d4d056d0e10ecb88b424ec9e68be398da5e (diff)
downloadffmpeg-edca1dd552efa1ebef016ca9eff4ce6757605819.tar.gz
xcbgrab: Check av_strdup() allocation
Bug-Id: CID 1274038
-rw-r--r--libavdevice/xcbgrab.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavdevice/xcbgrab.c b/libavdevice/xcbgrab.c
index 20a29d10f6..2435c9c1d0 100644
--- a/libavdevice/xcbgrab.c
+++ b/libavdevice/xcbgrab.c
@@ -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';
}