From patchwork Tue Jun 27 12:33:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4135 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp1982699vsb; Tue, 27 Jun 2017 05:33:36 -0700 (PDT) X-Received: by 10.223.161.204 with SMTP id v12mr17248517wrv.125.1498566816461; Tue, 27 Jun 2017 05:33:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498566816; cv=none; d=google.com; s=arc-20160816; b=D3wLmEgRqNy3C4tBxNvVoq370T0IvYAowpz8QdFs7xnJZbu+Pe6DnTxkEv2pFNDwbN 3C2W/Fjyy6v3AAuxIj0M3qQlarcieAjiDNkUIjpLsE2X/YSoJ2qEEasdRSTOFvR1nmxJ u60nzY70CNaoiugpurytRWyQ3m7rJv5DoU5lYosPXd0Qd8H5SR9Rzaw3/HMl2G0wwoON S3XQmTiqDFDLlzBznjC+7ZXCei2sVUz06J4wNECZE1Eh0V4Gov09V2FygLDUyV3s+UUj xS7W2jsf8z4gGDErCQtqtotWxV6lK0job3TMzB3dpOyV+lq2wNElFpWT12ThURcn9uW2 kivw== 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=JkdlnCmJPR9nmbZuRDVoakAM618zFH7JhftcoSMS3KE=; b=HXZ9IkxTAIotVg8l/DilGKdlWg9UQIYlXS0A744g7j4jgwu9umZ157gT/qBAcnnatq Neupck7vPrTsJNBs0uLqwMErghL8knOo8xrekhXYlXvTM+ap3DJ7ckJAqVOe/W7XrM2y y8VC2/jFzrohv7f4xOCyKOWykzjpmIQq2k28tzAzfiNg5aGEa6DKXoPdb53/dIYJrHco K7/U80rsaDBS0AfByvi284nUyFAgXCngcNOE96CfwmPG05YdV5qdNH2ErUVuvGCwO7mH 9jP+9O2VZfnNmN1nxREm0Lk3tdSi9zbtjU18eXjh4FDi3Kup5Si1UMMMS3JBxHDKK3Bw GOkw== 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 b204si2532451wmd.50.2017.06.27.05.33.35; Tue, 27 Jun 2017 05:33:36 -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 5696668A433; Tue, 27 Jun 2017 15:33:32 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe05-1.mx.upcmail.net (vie01a-dmta-pe07-1.mx.upcmail.net [84.116.36.17]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 14ED168A369 for ; Tue, 27 Jun 2017 15:33:26 +0300 (EEST) 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 1dPpgN-0000RA-1s for ffmpeg-devel@ffmpeg.org; Tue, 27 Jun 2017 14:33:27 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id doZN1v02F0S5wYM01oZPJ2; Tue, 27 Jun 2017 14:33:24 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 27 Jun 2017 14:33:22 +0200 Message-Id: <20170627123322.7732-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 Subject: [FFmpeg-devel] [PATCH] avcodec/wavpack: Fix invalid shift 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: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Fixes: 2377/clusterfuzz-testcase-minimized-6108505935183872 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 bc4b030425..a117e8aa81 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -846,9 +846,9 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, continue; } bytestream2_get_buffer(&gb, val, 4); - if (val[0] > 31) { + if (val[0] > 30) { av_log(avctx, AV_LOG_ERROR, - "Invalid INT32INFO, extra_bits = %d (> 32)\n", val[0]); + "Invalid INT32INFO, extra_bits = %d (> 30)\n", val[0]); continue; } else if (val[0]) { s->extra_bits = val[0];