From patchwork Thu Oct 10 02:07:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Steven X-Patchwork-Id: 15650 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 79BA7444869 for ; Thu, 10 Oct 2019 05:08:16 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5E5B86881B4; Thu, 10 Oct 2019 05:08:16 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpproxy21.qq.com (smtpbg704.qq.com [203.205.195.105]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C2248680330 for ; Thu, 10 Oct 2019 05:08:08 +0300 (EEST) X-QQ-mid: bizesmtp26t1570673284t6664rj7 Received: from localhost (unknown [47.90.47.25]) by esmtp10.qq.com (ESMTP) with id ; Thu, 10 Oct 2019 10:08:03 +0800 (CST) X-QQ-SSF: 01100000002000K0ZRF1B00A0000000 X-QQ-FEAT: FoGWmluInv0Zqaxj9mnmI2T438V/Uvo1Xd5BFXExvOGbw14XBjfldl9wes/yv 9TbdYzyS2PU+Uw4GVudzZ00Pe6q3UaYOOQZ6YuxFhd3JncE09SgOcmqDmhrnP1/e9lQc7NP A05p4crjgRxaZaeEE7lQo9kdoMd0GZgh2IWZbUrva7KOlk+UuNaxeutWBPlpk3gxW3QNgwg yspHfpLWIXur+G8IsbATqaPLFUUmOl01I3isn+W6HaeZR4ejr4ZR2oSXyhip5FpQ0EPX1XU 4c9S0fagm5WIlOzo7piy0fviPQ1nbQgKgLO1w2JDyl5JT/Fy3VY81IBSk= X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Thu, 10 Oct 2019 10:07:51 +0800 Message-Id: <20191010020756.30820-3-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:qybgforeign1 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH v2 3/8] avformat/mpc8: fix memleak when seek table too big 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/mpc8.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c index 0eb879ffc0..e452cd6878 100644 --- a/libavformat/mpc8.c +++ b/libavformat/mpc8.c @@ -168,6 +168,7 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off) size = gb_get_v(&gb); if(size > UINT_MAX/4 || size > c->samples/1152){ av_log(s, AV_LOG_ERROR, "Seek table is too big\n"); + av_free(buf); return; } seekd = get_bits(&gb, 4);