[Ffmpeg-cvslog] CVS: ffmpeg/libavformat v4l2.c,1.2,1.3

Luca Abeni CVS lucabe
Tue Feb 28 12:15:01 CET 2006


Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv14708/libavformat

Modified Files:
	v4l2.c 
Log Message:
Error path fix: close the video device on failure
Original patch by Flavio Pimentel Duarte (flaviop AT land DOT ufrj DOT br)


Index: v4l2.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/v4l2.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- v4l2.c	26 Feb 2006 13:22:32 -0000	1.2
+++ v4l2.c	28 Feb 2006 11:14:59 -0000	1.3
@@ -126,17 +126,20 @@
     if (res < 0 && errno == 515)
     {
         av_log(NULL, AV_LOG_ERROR, "QUERYCAP not implemented, probably V4L device but not supporting V4L2\n");
+        close(fd);
 
         return -1;
     }
     if (res < 0) {
         av_log(NULL, AV_LOG_ERROR, "ioctl(VIDIOC_QUERYCAP): %s\n",
                  strerror(errno));
+        close(fd);
 
         return -1;
     }
     if ((cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) == 0) {
         av_log(NULL, AV_LOG_ERROR, "Not a video capture device\n");
+        close(fd);
 
         return -1;
     }





More information about the ffmpeg-cvslog mailing list