From patchwork Fri Jan 4 19:22:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 11650 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 928C344E768 for ; Fri, 4 Jan 2019 21:23:49 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5665368A674; Fri, 4 Jan 2019 21:23:46 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe05-1.mx.upcmail.net (vie01a-dmta-pe05-1.mx.upcmail.net [84.116.36.11]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B711E689E65 for ; Fri, 4 Jan 2019 21:23:38 +0200 (EET) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe05.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1gfV4O-0000ND-0a for ffmpeg-devel@ffmpeg.org; Fri, 04 Jan 2019 20:23:48 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id fV3QgbRfK2WSsfV3QgfwsT; Fri, 04 Jan 2019 20:22:48 +0100 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.41.20 X-CNFS-Analysis: v=2.3 cv=E7kcWpVl c=1 sm=1 tr=0 a=I1eytVlZLDX1BM2VTtTtSw==:117 a=I1eytVlZLDX1BM2VTtTtSw==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=nZOtpAppAAAA:20 a=i5cADYYb57bcXf_0lUkA:9 a=pHzHmUro8NiASowvMSCR:22 a=n87TN5wuljxrRezIQYnT:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 4 Jan 2019 20:22:36 +0100 Message-Id: <20190104192236.25585-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190104192236.25585-1-michael@niedermayer.cc> References: <20190104192236.25585-1-michael@niedermayer.cc> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfIbl/AVkDneSD9EcXi0a6VzZcx8nUGjeoq4D/QAduvyyEoEFS/V39vHyT7BR+S4r661KLMUks4AScqi2inNxf4AavLWwila1a9Nh3ZNG6mXzIeXQQ6mw VGV1O9mRLM7Ofp1hkzXiI38aYJUEUoHHSi2+bCujp8CRjt4pkka+EpZK Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/h264_slice: Fix integer overflow in implicit_weight_table() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes: signed integer overflow: 2 * 2132811760 cannot be represented in type 'int' Fixes: 11156/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-6237685933408256 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/h264_slice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 2e158745a0..1c9a270fb6 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -678,7 +678,7 @@ static void implicit_weight_table(const H264Context *h, H264SliceContext *sl, in cur_poc = h->cur_pic_ptr->field_poc[h->picture_structure - 1]; } if (sl->ref_count[0] == 1 && sl->ref_count[1] == 1 && !FRAME_MBAFF(h) && - sl->ref_list[0][0].poc + (int64_t)sl->ref_list[1][0].poc == 2 * cur_poc) { + sl->ref_list[0][0].poc + (int64_t)sl->ref_list[1][0].poc == 2LL * cur_poc) { sl->pwt.use_weight = 0; sl->pwt.use_weight_chroma = 0; return;