From patchwork Tue May 23 22:21:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 3723 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.2 with SMTP id 2csp24162vsk; Tue, 23 May 2017 15:21:52 -0700 (PDT) X-Received: by 10.28.158.134 with SMTP id h128mr3510609wme.99.1495578112014; Tue, 23 May 2017 15:21:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495578111; cv=none; d=google.com; s=arc-20160816; b=YjXJKka4/SlZRpewNjZrDyI97Oc6UNrhjpnbYjb4ngM6WyT2bnzPaTfUy3ytirdmJR WUZ6CPS6KnlI+BkSSs0t/ijCf9VO+ME0u51Dg5gtB3iuxRVpFCLCxwVOzlB0VNgHU0IG bREZBkWl/2B1yPztGhd4Lx8KdFxBuUniBqEQxYnhxBDxaOpJZcqiJN6Vz4PYX4lFqdOB a6LmwvDisNat3d89NCpLJfIx9xnt36efAC9bSIF69v6O+jp0szhnKE27ppwSN0wTc+Yd TM3mOdbyLDjU/zsaKhJGYq/xb9IuLM5aQLDlt7OS9Mla9D2Ygp5IvIE4jBuTc9TG6Jm4 VGFA== 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:message-id:date:to:from:delivered-to :arc-authentication-results; bh=D4oFbOXM3FYLvrI76kuHcwmrkeqIZNr3kcTbyN+KgUE=; b=DQ/DyMASrr9rqnlFV4ntRUbuPfMlTY2FeDwQiz4vMBUfR9vYPb2I+Hz14KKgkPlIb2 U1B6bdFIhbzHqXCf4eU6cLB0ua/TGgB/+Y/6zAbTnj1QfvC5o8nn42K/fOTyXRTKjDgj x7yuWFcKmv6Aq29VIY99OBQVHD/KiLpZHcZeQAbT+Jq9fO7qN6HOloszSGfO394kOpuk 1Nfs4QCDSRz29DjQafSX+0DOmx22TE4inF8mSEyWrDE49+BGEKsas1jq8rv2tUuHRaGA zkNP9Zw/0C9ej8eXJESdHZV4thmKMLjRuGk9oCRvAwOWwhjP8BRLpMtzoB6rJfVro8SZ ASLA== 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 71si17699480wrb.134.2017.05.23.15.21.51; Tue, 23 May 2017 15:21:51 -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 1C34968982B; Wed, 24 May 2017 01:21:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe02-3.mx.upcmail.net (vie01a-qmta-pe02-3.mx.upcmail.net [62.179.121.183]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0E203689213 for ; Wed, 24 May 2017 01:21:33 +0300 (EEST) Received: from [172.31.218.46] (helo=vie01a-dmta-pe05-1.mx.upcmail.net) by vie01a-pqmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dDIBK-0001K5-Li for ffmpeg-devel@ffmpeg.org; Wed, 24 May 2017 00:21:34 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dDIBE-0002pR-OQ for ffmpeg-devel@ffmpeg.org; Wed, 24 May 2017 00:21:28 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id PyMN1v01N0S5wYM01yMPJr; Wed, 24 May 2017 00:21:23 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 24 May 2017 00:21:20 +0200 Message-Id: <20170523222121.2867-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/wavpack: Fix: runtime error: signed integer overflow: 3 * -2147483648 cannot be represented in type 'int' 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: 1776/clusterfuzz-testcase-minimized-6191258231898112 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/wavpack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 74ca2d492c..1b13b676b6 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -542,9 +542,9 @@ static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb, t = s->decorr[i].value; if (t > 8) { if (t & 1) - A = 2 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]; + A = 2U * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]; else - A = (3 * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1; + A = (int)(3U * s->decorr[i].samplesA[0] - s->decorr[i].samplesA[1]) >> 1; s->decorr[i].samplesA[1] = s->decorr[i].samplesA[0]; j = 0; } else {