diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2006-12-13 10:18:38 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2006-12-13 10:18:38 +0000 |
commit | 7224e89638ea8d3ec6e4f705f57c168efbe1aca8 (patch) | |
tree | e8bcb44a6bcf9ab1cc3d19b79c03ab20948f64d6 /libavformat/x11grab.c | |
parent | ba78f9d486b9690cbd8ae70fba9d05793a1eb667 (diff) | |
download | ffmpeg-7224e89638ea8d3ec6e4f705f57c168efbe1aca8.tar.gz |
dont segv is ap->device is not set, display error message
Originally committed as revision 7312 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/x11grab.c')
-rw-r--r-- | libavformat/x11grab.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/x11grab.c b/libavformat/x11grab.c index e0e40184cb..4b237f6c26 100644 --- a/libavformat/x11grab.c +++ b/libavformat/x11grab.c @@ -101,6 +101,11 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) return AVERROR_IO; } + if (!ap->device) { + av_log(s1, AV_LOG_ERROR, "AVParameters don't specify any device. Use -vd.\n"); + return AVERROR_IO; + } + sscanf(ap->device, "x11:%d,%d", &x_off, &y_off); av_log(s1, AV_LOG_INFO, "device: %s -> x: %d y: %d width: %d height: %d\n", ap->device, x_off, y_off, ap->width, ap->height); |