avformat/swfdec: fix memleak when inflateInit failed

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
This commit is contained in:
Steven Liu 2019-10-10 10:07:55 +08:00
parent a3655a5cb2
commit 70c6e84069

View File

@ -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;