summaryrefslogtreecommitdiff
path: root/libavdevice/x11grab.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavdevice/x11grab.c')
-rw-r--r--libavdevice/x11grab.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index 305fda6e76..06cec9daef 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -169,6 +169,9 @@ x11grab_read_header(AVFormatContext *s1)
AVRational framerate;
param = av_strdup(s1->filename);
+ if (!param)
+ goto out;
+
offset = strchr(param, '+');
if (offset) {
sscanf(offset, "%d,%d", &x_off, &y_off);
@@ -319,6 +322,7 @@ x11grab_read_header(AVFormatContext *s1)
st->codec->bit_rate = x11grab->frame_size * 1/av_q2d(x11grab->time_base) * 8;
out:
+ av_free(param);
return ret;
}