Add missing check on the return value of the VIDIOCSWIN ioctl.
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Sat, 27 Dec 2008 11:40:07 +0000 (11:40 +0000)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Sat, 27 Dec 2008 11:40:07 +0000 (11:40 +0000)
Originally committed as revision 16360 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavdevice/v4l.c

index b350adb0cd21c70242c96e18a5fe674771d359a6..af9f0a47138493a21ba27b603255f35a13d3ddd3 100644 (file)
@@ -181,7 +181,10 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
         s->video_win.chromakey = -1;
         s->video_win.flags = 0;
 
-        ioctl(video_fd, VIDIOCSWIN, s->video_win);
+        if (ioctl(video_fd, VIDIOCSWIN, s->video_win) < 0) {
+            av_log(s1, AV_LOG_ERROR, "VIDIOCSWIN: %s\n", strerror(errno));
+            goto fail;
+        }
 
         s->frame_format = pict.palette;