From patchwork Mon Jul 2 18:45:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 9571 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp286113jad; Mon, 2 Jul 2018 11:46:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd/WYL/eJ7kO9Jqo2n/cKUj4KEH54djFX4TVUzplZY/5bi89cN/hvccXLwd88lTrfjb5cHs X-Received: by 2002:a1c:8313:: with SMTP id f19-v6mr8483045wmd.144.1530557192897; Mon, 02 Jul 2018 11:46:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530557192; cv=none; d=google.com; s=arc-20160816; b=LdZmAzA9fMp27BMz5SSudbC1SiH9CnfTRJ0lYb5CcoDfKwA8QNoIuCe5KFJ1eL5MJG HDwv2fULc38lhTyhUtvitcvjwz4hNdvbXvbV00bcnMbDBhadn+FN+Edv7nNgWhtcKBzT LJWlX9JkxqY8kk+jC6mOdgP9jQMn5D5AAeBdax95jqcu/L6izj5uOZndh6zNn9OjW4jv aJlsDHNgAnyCjOfxcSuhEbpZos17ohlwKE26fpAox3s9NInHQj2EqKGYapBKC+Ak3mPk QQf75as4XP6U89ujHBm0v7hivDQ0bjjcm084ifho/0U80MGlKhR6cZV7xELjb4j/lfeR 3dTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=QIiSUPg6/lcD3Dn7af9GggcNUfI2afKg/W+3H1rZtvw=; b=qVCK16PbYwQRQMislh+4+6ndoSjw+UdL7R4+QGXC04r5/jxp/OkZ5NTa4qmEG48lYR Sf4WO6+CzB1hgBYWpqWdVK7DSI+RbNdbA2zy96p/11uV1X32fP1PIGzvfF/SlK0iLXue bXA+b0bPY3hl3bwTTgAKsjfNvI4eGYPI1Zf3AvdquwcICUHl0q77bv66gP2pixsV5EyC xXN2LTerYfdOUDl23Cq3+whjcLecelH5LKfboyaCxhxLozH8KNaS1OAtmJOf6szmCSMz h/zmyN+Y9P9UKS/Kr0aqY/gu9NjXIPL3KwsvC/B05dbSfQqwfowVXLg3Y1PV7/vlIn9h fvDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id w11-v6si7127502wrn.206.2018.07.02.11.46.32; Mon, 02 Jul 2018 11:46:32 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9903268A58F; Mon, 2 Jul 2018 21:46:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe08-3.mx.upcmail.net (vie01a-dmta-pe08-3.mx.upcmail.net [84.116.36.22]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 925BB68A501 for ; Mon, 2 Jul 2018 21:46:04 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe08.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fa3pw-0008Tc-1f for ffmpeg-devel@ffmpeg.org; Mon, 02 Jul 2018 20:46:08 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id 5um31y01P0S5wYM01um4ds; Mon, 02 Jul 2018 20:46:05 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 2 Jul 2018 20:45:10 +0200 Message-Id: <20180702184511.12534-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180702184511.12534-1-michael@niedermayer.cc> References: <20180702184511.12534-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 3/4] avcodec/shorten: Fix undefined integer overflow 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes: signed integer overflow: 8454144 * 256 cannot be represented in type 'int' Fixes: 8788/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5728205041303552 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/shorten.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index 18a12d0b97..79656e7757 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -177,7 +177,7 @@ static void fix_bitshift(ShortenContext *s, int32_t *buffer) buffer[i] = 0; } else if (s->bitshift != 0) { for (i = 0; i < s->blocksize; i++) - buffer[i] *= 1 << s->bitshift; + buffer[i] *= 1U << s->bitshift; } }