dont segv is ap->device is not set, display error message

Originally committed as revision 7312 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Baptiste Coudurier 18 years ago
parent ba78f9d486
commit 7224e89638
  1. 5
      libavformat/x11grab.c

@ -101,6 +101,11 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
return AVERROR_IO; 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); 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); 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);

Loading…
Cancel
Save