summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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';
}