[FFmpeg-cvslog] r16316 - trunk/libavdevice/v4l.c

stefano subversion
Fri Dec 26 10:12:12 CET 2008


Author: stefano
Date: Fri Dec 26 10:12:12 2008
New Revision: 16316

Log:
Add missing check on the result of a VIDIOCCAPTURE ioctl.

Modified:
   trunk/libavdevice/v4l.c

Modified: trunk/libavdevice/v4l.c
==============================================================================
--- trunk/libavdevice/v4l.c	Fri Dec 26 10:07:51 2008	(r16315)
+++ trunk/libavdevice/v4l.c	Fri Dec 26 10:12:12 2008	(r16316)
@@ -186,7 +186,10 @@ static int grab_read_header(AVFormatCont
         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;




More information about the ffmpeg-cvslog mailing list