avformat/swfdec: fix memleak when inflateInit failed

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
pull/324/head
Steven Liu 6 years ago
parent a3655a5cb2
commit 70c6e84069
  1. 2
      libavformat/swfdec.c

@ -152,6 +152,8 @@ static int swf_read_header(AVFormatContext *s)
swf->zpb->seekable = 0;
if (inflateInit(&swf->zstream) != Z_OK) {
av_log(s, AV_LOG_ERROR, "Unable to init zlib context\n");
av_freep(&swf->zbuf_in);
av_freep(&swf->zbuf_out);
return AVERROR(EINVAL);
}
pb = swf->zpb;

Loading…
Cancel
Save