From patchwork Wed Oct 10 23:45:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 10628 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:ab0:73d2:0:0:0:0:0 with SMTP id m18csp1462672uaq; Wed, 10 Oct 2018 16:49:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV60T/w9wbGQZ3oJK/HIVwhlBrZMRWNTTz/knC3RpQKUJM/FlucggIsZBvkZOtd/sdsnyKTOJ X-Received: by 2002:a5d:56cb:: with SMTP id m11-v6mr24157078wrw.58.1539215364477; Wed, 10 Oct 2018 16:49:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539215364; cv=none; d=google.com; s=arc-20160816; b=IA7kKS1KkMpbH74vku8gW6ofR3NFqZGzBH3cRDJdYjGdrvuxcKKZ3ga9Yy9qfJ5JnO 47Nb3RDdTpmhhTJVKIqFphRWh0aRZi+9kwHHYkxMkawxxUVfd2Y13qcX0vif9v8Rf3OT rqD6eaEpxu0FVKkfRByubW7ZfayXZoT7JZgZicCquiUtwqgn85E5QDNm+0A7hSxU5mek 0VL3wYTNA9SJolIWsiRlqOJQ9VINqO94nmO23YbDh5TmEOPjhyBzFW/rnJC+W2FE0V1s vWc7555QxBs0azGtjvRNokhzKaRWw1qL6FzKIZjCcuCEOolW3VaY+yQy1eCmzBc7ME4D xv/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=VFL5ix9i1J6Dps2QA7CU5p7J314y93mxSbCegnq8MpM=; b=DjJ/giAif+tgmX1ljGQN3xgcllWVzGtyoPC8G4ElM7AtP7tA17R7WXo3wAiqJNGgDo 6DTk6UAEbgLO3HrFinMozpmxgJr4k7NiUjT2S05dzh2ePKcIR5HhdTQD2uxRfiGDT2H6 lYREPB0iLIHhV7KWviAWsywO59rHAqS2BuHuerWbfR9PPW7Ep9tucenfn70X8fcH0CCV akg2QcuJKYfBjKvkt6Auxg+v7+UZzUXw/k/yyb98XUyVwqVvGxrWY1iPJ55P1trUmznP Bqh2gE8WZHBBPloU8ITXBLxt4Wh16fYB6sV3pILPTzMY/FsfddqUeH9U3rnwM7z7OsYU lFYQ== 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 o18-v6si21623988wrh.433.2018.10.10.16.49.24; Wed, 10 Oct 2018 16:49:24 -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 BD6A268A1D1; Thu, 11 Oct 2018 02:48:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe02-1.mx.upcmail.net (vie01a-qmta-pe02-1.mx.upcmail.net [62.179.121.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C63DF68A180 for ; Thu, 11 Oct 2018 02:48:37 +0300 (EEST) Received: from [172.31.218.51] (helo=vie01a-dmta-pe07-3.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1gAODs-0001Bn-3W for ffmpeg-devel@ffmpeg.org; Thu, 11 Oct 2018 01:49:00 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe07.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1gAODm-0001QM-RK for ffmpeg-devel@ffmpeg.org; Thu, 11 Oct 2018 01:48:54 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id lzok1y00Z0S5wYM01zolUl; Thu, 11 Oct 2018 01:48:45 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 11 Oct 2018 01:45:29 +0200 Message-Id: <20181010234532.5857-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/4] avcodec/ra144: Fix integer overflow in add_wav() 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: -2144033225 + -5208934 cannot be represented in type 'int' Fixes: 10633/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RA_144_fuzzer-5679133791617024 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/ra144.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c index 573703d70b..65a744876c 100644 --- a/libavcodec/ra144.c +++ b/libavcodec/ra144.c @@ -1516,7 +1516,7 @@ static void add_wav(int16_t *dest, int n, int skip_first, int *m, if (v[0]) { for (i=0; i < BLOCKSIZE; i++) - dest[i] = ((int)(s1[i]*(unsigned)v[0]) + s2[i]*v[1] + s3[i]*v[2]) >> 12; + dest[i] = (int)((s1[i]*(unsigned)v[0]) + s2[i]*v[1] + s3[i]*v[2]) >> 12; } else { for (i=0; i < BLOCKSIZE; i++) dest[i] = ( s2[i]*v[1] + s3[i]*v[2]) >> 12;