On Tue, Sep 29, 2015 at 12:14 PM, Przemysław Sobala
<przemyslaw.sob...@grupawp.pl> wrote:
> Fixes #4886
> ---
>  libavformat/img2dec.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
> index 70f0b09..fcd2b76 100644
> --- a/libavformat/img2dec.c
> +++ b/libavformat/img2dec.c
> @@ -444,8 +444,12 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket 
> *pkt)
>      }
>
>      res = av_new_packet(pkt, size[0] + size[1] + size[2]);
> -    if (res < 0)
> +    if (res < 0) {
> +        for (i = 0; i < 3; i++) {
> +            avio_closep(&f[i]);
> +        }
>          return res;
> +    }
>      pkt->stream_index = 0;
>      pkt->flags       |= AV_PKT_FLAG_KEY;
>      if (s->ts_from_file) {
> --
> 1.8.3.1
>

This needs a !s->is_pipe check, otherwise it shall not be closed.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to