From patchwork Sat May 20 21:01:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 3704 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.2 with SMTP id 2csp827126vsk; Sat, 20 May 2017 14:01:44 -0700 (PDT) X-Received: by 10.223.133.200 with SMTP id 8mr6873299wru.94.1495314104239; Sat, 20 May 2017 14:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495314104; cv=none; d=google.com; s=arc-20160816; b=x1RpklQ02RQfAu++o3LD3asdwsphQ5D6s5wGGNmHpxFlhwO5Zh/Pe9zdeo/g4w7E2e UZ797kEH43zfz1sKjcM1O2KfhzhGf+21dNcyG/spU1B7FuIP+fOscMG8Hn/kbtMT0eew DsMUGhGM4Wp0rFlB6wOL7f5UqXK6BsZYZx9GF5BB7U5TlEZTUuuYrumE6aNMKkdTdnqX 7SyHFv0eBEO147IxkA29DnqilseagHU3YzWGodLMuI/Nk7Sco+ZGT5IBrkiveJy3up70 73XWmP4VRlPXFV1UhQlTRwVjB3aja6GX8Y75ZpAtdEmxNjIXaQshN3nP8f7xfvKGpRF7 Sw4A== 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=r6L6Gi+C5o1uWq4SrLAAg6Y8dfdG88ovDQU+5aHmNgg=; b=EMtnOUe4ter0ApZPa6Vt7XWP73Q5X4CeWxWNnrwbOCs/6sKMFjSLziUXK4+youi/Us OG2ryGvtsnSguwFb3rKa+lqPCCH9hXiYLth8q0oA7lVekG3Ncz4ixmpAMiREH2kiwWdW zM8vHzgZaCIX4DKoGh/rRm7GEZjCRapct7EyEkzCYTaARR1ivS2aNFJ2cGJEKSPU2OIn PlUVjsLjNkXNjwwac5qflaMXCzm5eDJXT7eYWdSMm+laOfqLn58P+EnTcNsOib0Zqhp+ uejvYAfaQBB65p8J9lJRZj0sb9R7bqiGSUY0OnDslOW30liO56DCY4TdabbY+xQek/Gr j5FQ== 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 y6si7677888wrc.2.2017.05.20.14.01.43; Sat, 20 May 2017 14:01:44 -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 6C1A2689A1A; Sun, 21 May 2017 00:01:21 +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-pe06-1.mx.upcmail.net [84.116.36.14]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C072E689975 for ; Sun, 21 May 2017 00:01:14 +0300 (EEST) 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 1dCBUx-0003wN-8K for ffmpeg-devel@ffmpeg.org; Sat, 20 May 2017 23:01:15 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id Nl161v00Q0S5wYM01l17js; Sat, 20 May 2017 23:01:07 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 20 May 2017 23:01:03 +0200 Message-Id: <20170520210104.4943-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170520210104.4943-1-michael@niedermayer.cc> References: <20170520210104.4943-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/3] avcodec/mlpdec: Fix runtime error: shift exponent -5 is negative 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 part of 1708/clusterfuzz-testcase-minimized-5035111957397504 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/mlpdec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index eac19a0d5e..c0a23c5f0d 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -861,8 +861,13 @@ static int read_decoding_params(MLPDecodeContext *m, GetBitContext *gbp, if (s->param_presence_flags & PARAM_OUTSHIFT) if (get_bits1(gbp)) { - for (ch = 0; ch <= s->max_matrix_channel; ch++) + for (ch = 0; ch <= s->max_matrix_channel; ch++) { s->output_shift[ch] = get_sbits(gbp, 4); + if (s->output_shift[ch] < 0) { + avpriv_request_sample(m->avctx, "Negative output_shift"); + s->output_shift[ch] = 0; + } + } if (substr == m->max_decoded_substream) m->dsp.mlp_pack_output = m->dsp.mlp_select_pack_output(s->ch_assign, s->output_shift,