[FFmpeg-devel] [PATCH] avcodec/pngdec: init zlib on decoder init.

Benoit Fouet benoit.fouet at free.fr
Thu Nov 20 09:47:27 CET 2014


Hi,

----- Mail original -----
> ---
>  libavcodec/pngdec.c | 30 ++++++++++++------------------
>  1 file changed, 12 insertions(+), 18 deletions(-)
> 
> diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
> index 57b73c1..e3d61f6 100644
> --- a/libavcodec/pngdec.c
> +++ b/libavcodec/pngdec.c
> @@ -411,11 +411,6 @@ static int decode_zbuf(AVBPrint *bp, const
> uint8_t *data,
>      unsigned buf_size;
>      int ret;
>  
> -    zstream.zalloc = ff_png_zalloc;
> -    zstream.zfree  = ff_png_zfree;
> -    zstream.opaque = NULL;
> -    if (inflateInit(&zstream) != Z_OK)
> -        return AVERROR_EXTERNAL;
>      zstream.next_in  = (unsigned char *)data;
>      zstream.avail_in = data_end - data;
>      av_bprint_init(bp, 0, -1);
> @@ -437,12 +432,10 @@ static int decode_zbuf(AVBPrint *bp, const
> uint8_t *data,
>          if (ret == Z_STREAM_END)
>              break;
>      }
> -    inflateEnd(&zstream);
>      bp->str[bp->len] = 0;
>      return 0;
>  
>  fail:
> -    inflateEnd(&zstream);
>      av_bprint_finalize(bp, NULL);
>      return ret;
>  }
> 

Actually, this one shouldn't be touched, will resend shortly...

-- 
Ben


More information about the ffmpeg-devel mailing list