From patchwork Mon Aug 13 00:24:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 9965 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp2577920jad; Sun, 12 Aug 2018 17:25:47 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwoZv4UPI/gVmbuirYUh6n0O4WWdEirf5tiyqEi8YWEIwCFy5BBO3Obg/9F7Y1Y37QvULfM X-Received: by 2002:a1c:ea9c:: with SMTP id g28-v6mr6759249wmi.65.1534119947301; Sun, 12 Aug 2018 17:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534119947; cv=none; d=google.com; s=arc-20160816; b=HrGhzT3br0grXCim/p0+1AxBlzbImurT3josSV0Rfsvrbkp7VWPjI53dq1xeLrjL9h 9LnFlRqcuqjBP7OV7Et4WWIsQRnPgvPRQ72Lold+KG9S3eSHeqC63H42eUj0olhzptj3 DzjqQGwPlNF5zm+EI1CcCDvcgNxj3mutMj1NH9z1xxgn7zhkJhI83L9/R3FcufOPL98S ihkFKS/VxZV0NawLn0TTDcRmSlZQrtM0Ykx0WIW5EdkDhNNtf+NjhEAPaOAMq7aS8QZR MDrbDsl5NZWOObMrf5FWAc2niqZHKWA4Lq/EtnMReBg/SVYpIvy9HJI3pPW/x5qDjyCQ JHHQ== 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=YmU6XURAhwRFttmqRW0bE2A28FUXyNfLM9IQRzOOX74=; b=hJUgeH+mWIGeDiEdKcKzzHmg4Y4DLaVAUKlKmZMDRf7pSAQg7+qJJ4MymhLrndmy7W UJEAEYBZOteuygKdC+ClP4BBmfdVh+GLssfVQDqevurwnECRRN3l+NAJSeEV5H/18xFy oM4FJvdYXeYoTQ4PPjroUzm4mkYJ/LesigxB8e1mVDGxjHr6ytzw4WefWLSO4THdKoVB 8Q5ImsvV0KgWNU57VJp/WC9gexJH6Z6epGc8oKJEg6TXmNXJwsFsInl3JHjTu32tUm8v c6t1tCCQyv4kAy5NijQuyhxMsV14eykqekJWnBRvh7xhZbucbE24b84sLx7+U6HSNe4f 8AEA== 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 g8-v6si10924232wru.338.2018.08.12.17.25.47; Sun, 12 Aug 2018 17:25:47 -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 3B83968A5D4; Mon, 13 Aug 2018 03:25:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe08-2.mx.upcmail.net (vie01a-dmta-pe08-2.mx.upcmail.net [84.116.36.21]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 247AA68A2DB for ; Mon, 13 Aug 2018 03:24:54 +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 1fp0fd-0004NF-7t for ffmpeg-devel@ffmpeg.org; Mon, 13 Aug 2018 02:25:17 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id NQRB1y00G0S5wYM01QRCoQ; Mon, 13 Aug 2018 02:25:12 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 13 Aug 2018 02:24:23 +0200 Message-Id: <20180813002423.10292-6-michael@niedermayer.cc> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180813002423.10292-1-michael@niedermayer.cc> References: <20180813002423.10292-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 6/6] avcodec/cfhd: Use the actual count instead of the expected in peak_table() 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: out of array access (no testcase) Signed-off-by: Michael Niedermayer --- libavcodec/cfhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c index 1959762f0e..846d334b9b 100644 --- a/libavcodec/cfhd.c +++ b/libavcodec/cfhd.c @@ -697,7 +697,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame, goto end; } if (s->peak.level) - peak_table(coeff_data - expected, &s->peak, expected); + peak_table(coeff_data - count, &s->peak, count); if (s->difference_coding) difference_coding(s->plane[s->channel_num].subband[s->subband_num_actual], highpass_width, highpass_height);