Commit fd867ffd authored by Stefano Sabatini's avatar Stefano Sabatini

Add missing check on the result of a VIDIOCCAPTURE ioctl.

Originally committed as revision 16316 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent c40432d3
...@@ -186,7 +186,10 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) ...@@ -186,7 +186,10 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
s->frame_format = pict.palette; s->frame_format = pict.palette;
val = 1; val = 1;
ioctl(video_fd, VIDIOCCAPTURE, &val); if (ioctl(video_fd, VIDIOCCAPTURE, &val) < 0) {
av_log(s1, AV_LOG_ERROR, "VIDIOCCAPTURE: %s\n", strerror(errno));
goto fail;
}
s->time_frame = av_gettime() * s->time_base.den / s->time_base.num; s->time_frame = av_gettime() * s->time_base.den / s->time_base.num;
s->use_mmap = 0; s->use_mmap = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment