Commit 75ca8c51 authored by lucabe's avatar lucabe

Error path fix: close the video device on failure

Original patch by Flavio Pimentel Duarte (flaviop AT land DOT ufrj DOT br)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@5075 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 9afce7b0
......@@ -126,17 +126,20 @@ static int device_open(const char *devname, uint32_t *capabilities)
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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment