diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2008-12-26 09:12:12 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2008-12-26 09:12:12 +0000 |
commit | fd867ffd432eb3da2403f6fb5e02e90ae4dadbc8 (patch) | |
tree | a25e9a2c611490cc5596a93fcf876087ada99030 | |
parent | c40432d30c7c03cd8557cd55af119f91c715c4c4 (diff) | |
download | ffmpeg-fd867ffd432eb3da2403f6fb5e02e90ae4dadbc8.tar.gz |
Add missing check on the result of a VIDIOCCAPTURE ioctl.
Originally committed as revision 16316 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavdevice/v4l.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavdevice/v4l.c b/libavdevice/v4l.c index e260dac451..6212955352 100644 --- a/libavdevice/v4l.c +++ b/libavdevice/v4l.c @@ -186,7 +186,10 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) s->frame_format = pict.palette; 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->use_mmap = 0; |