From patchwork Thu Oct 10 02:07:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Steven X-Patchwork-Id: 15654 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 268A6446632 for ; Thu, 10 Oct 2019 05:08:26 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 15FE9687F4F; Thu, 10 Oct 2019 05:08:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbgsg2.qq.com (smtpbgsg2.qq.com [54.254.200.128]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 632536881A8 for ; Thu, 10 Oct 2019 05:08:19 +0300 (EEST) X-QQ-mid: bizesmtp12t1570673293t9wb7pa6 Received: from localhost (unknown [47.90.47.25]) by esmtp6.qq.com (ESMTP) with id ; Thu, 10 Oct 2019 10:08:12 +0800 (CST) X-QQ-SSF: 01100000002000K0ZRF1B00A0000000 X-QQ-FEAT: 5cW5f8fCC4BDvHOjIeZWA5XnzEAHlY2Go0LCV/Pd+F93/CJkQancs4KzHifMY 5G6PfMiMmfbzmJWSaOooSVW69Nzeog8BQbsdMSVjyIdE7mFQoKkuX5+0p9wtyYz1PYEvyvs mavLT0gHBcul4S8/lNr/cv03ZWAYHTPCibROrBCOjEBZMqXlS0ECubmedZqNj+LwFn5tHVg BDqkQop+0q6zFG5hpVaq5QKKBxBY+23R20+PVzBf1sqBmFQXYqQfxbLjEtM5GeInrqdYFlW QcIyTTyIST07VsrYwGrvX4svC0IDuVVm9IrCHcV1gWUd7ek0qDU8QTsrgcSnGWUeXqqg== X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Thu, 10 Oct 2019 10:07:55 +0800 Message-Id: <20191010020756.30820-7-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.10.1.382.ga23ca1b.dirty In-Reply-To: <20191010020756.30820-1-lq@chinaffmpeg.org> References: <20191010020756.30820-1-lq@chinaffmpeg.org> X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybgforeign:qybgforeign2 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH v2 7/8] avformat/swfdec: fix memleak when inflateInit failed X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Steven Liu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Steven Liu --- libavformat/swfdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c index 85bd30404e..a9358f09a9 100644 --- a/libavformat/swfdec.c +++ b/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;