Browse Source

Add missing check on the return value of the VIDIOCSWIN ioctl.

Originally committed as revision 16360 to svn://svn.ffmpeg.org/ffmpeg/trunk
Stefano Sabatini 16 years ago
parent
commit
faf67322dc
1 changed files with 4 additions and 1 deletions
  1. 4 1
      libavdevice/v4l.c

+ 4 - 1
libavdevice/v4l.c

@@ -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;