[FFmpeg-devel] [PATCH 1/1] libavdevice/v4l2: fix descriptors leak	on error paths
    Benoit Fouet 
    benoit.fouet at free.fr
       
    Thu Sep  4 10:00:41 CEST 2014
    
    
  
Hi,
----- Mail original -----
> From: Dmitry Volyntsev <xeioexception at gmail.com>
> 
> Signed-off-by: Dmitry Volytnsev <xeioexception at gmail.com>
> ---
>  libavdevice/v4l2.c |   37 ++++++++++++++++++++-----------------
>  1 file changed, 20 insertions(+), 17 deletions(-)
> 
> diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
> index 9f9f944..7b9e2f3 100644
> --- a/libavdevice/v4l2.c
> +++ b/libavdevice/v4l2.c
[...]
> @@ -956,6 +955,10 @@ static int v4l2_read_header(AVFormatContext *s1)
>          st->codec->bit_rate = s->frame_size *
>          av_q2d(st->avg_frame_rate) * 8;
>  
>      return 0;
> +
> +fail:
> +    v4l2_close(s->fd);
> +    return res;
>  }
>  
>  static int v4l2_read_packet(AVFormatContext *s1, AVPacket *pkt)
This is not really a 'fail' path when it is reached after listing the formats or the standards.
LGTM anyway.
-- 
Ben
    
    
More information about the ffmpeg-devel
mailing list