Ticket #1560: v4l2.patch

File v4l2.patch, 824 bytes (added by Tristan Matthews, 14 years ago)

fix error handling for v4l2

  • libavdevice/v4l2.c

    From 002182754dd7076b66b7f3188c0b95b47fbec3df Mon Sep 17 00:00:00 2001
    From: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
    Date: Thu, 19 Jul 2012 21:54:18 -0400
    Subject: [PATCH 1/1] v4l2: check correct file descriptor in error handling
    
    ---
     libavdevice/v4l2.c |    2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
    index 4829b1b..96762a6 100644
    a b static int device_open(AVFormatContext *ctx)  
    177177    }
    178178#if CONFIG_LIBV4L2
    179179    fd_libv4l = v4l2_fd_open(fd, 0);
    180     if (fd < 0) {
     180    if (fd_libv4l < 0) {
    181181        err = AVERROR(errno);
    182182        av_log(ctx, AV_LOG_ERROR, "Cannot open video device with libv4l neither %s : %s\n",
    183183               ctx->filename, strerror(errno));