From patchwork Sun Jun 26 13:51:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 36454 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8b27:b0:88:1bbf:7fd2 with SMTP id l39csp1464749pzh; Sun, 26 Jun 2022 06:52:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u6fu0fz4zfV97bffY0BgCfOgMrGM/KWctHdSsecScaRveqe9tBI0JA3oUPxtQnhgEJGGHY X-Received: by 2002:a17:907:7255:b0:718:cbb7:4b5c with SMTP id ds21-20020a170907725500b00718cbb74b5cmr8426882ejc.231.1656251521437; Sun, 26 Jun 2022 06:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656251521; cv=none; d=google.com; s=arc-20160816; b=AvSJqkgxELsn2zDaQCuh2DO1WqaemlXyNyrZb4O1GHfeGL83JG2mhOWJDYy4pbQ9HA Rdih+Z9uL34fHXUBYbzjUvu9q90D2JklH2YSfX7AWfL0Ym9H4jFi/03OtmW/v+PTcE46 ijqrNJT5xpQTuvkP4qP3hgabEqId2fgT03Pv1BCqdaQZpB3CKbos5egg//kJzD2744IR xy+zScaJvrBLwn+VECFLdaEr5qUjR8VuFSzB7/XU0WOYE2NXMsNv97VfC0CeBLdGaqDs J0vE6sCvUvLjiVjyjuYwv6Sy3tiIdB/NQVV+Wvybg/QfF/OKtxfgqE2Hyo/PMhu62650 Dn+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: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; bh=xJF59D9uncG5jrBArc1zVWvhNJ42XSg9Vo/WXo6oCB4=; b=JY1Cp/61KI+W+b81rrgjeJuQf5jRJob+Ia6zFTA6Afe/ahup2NE95xMUnCj+t27T6t NPhDRLYjLY+m5EM3Pp0xrJw26ymIStBWBArXJ2IBJPCqj15rVred/AcHlSupjwqkSPNv Mb//0Q9lZ4z0tQ5KeTNWux8QRX4A1xjFDviWziRl5/1OHei9/LEIKJ/mkjfDdDHHWp4f 84pGSohOQgtYgNK/PZ8ZlBrVFaeHBu+SjkZWRMHtweMtO8JxyHuETavFM/ENhLUuTx4K xZagHpUeJLqIIpQXK5dsSDq+Lo8Gma8+t7LpVZaDVCsKM0sYQ/hm7iEobYbS6pPOS8NM qFOw== 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 nb28-20020a1709071c9c00b00707e0e3cd7csi9538353ejc.359.2022.06.26.06.52.00; Sun, 26 Jun 2022 06:52:01 -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 98EBF68B79C; Sun, 26 Jun 2022 16:51:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-at02-3.mx.upcmail.net (vie01a-dmta-at02-3.mx.upcmail.net [62.179.121.150]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6094168B782 for ; Sun, 26 Jun 2022 16:51:48 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-at02.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1o5Sfz-00093d-NK for ffmpeg-devel@ffmpeg.org; Sun, 26 Jun 2022 15:51:47 +0200 Received: from ren-mail-psmtp-mg01. ([80.109.253.241]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id 5SfKo2CR78s8U5SfzoAncM; Sun, 26 Jun 2022 15:51:47 +0200 Received: from localhost ([213.47.68.29]) by ren-mail-psmtp-mg01. with ESMTP id 5SfyoljBzOPqF5Sfyo2Se9; Sun, 26 Jun 2022 15:51:46 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.4 cv=OcX7sjfY c=1 sm=1 tr=0 ts=62b86473 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=NEAV23lmAAAA:8 a=Xrasc1zhOIzlxSE-RdgA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 26 Jun 2022 15:51:46 +0200 Message-Id: <20220626135146.13096-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-CMAE-Envelope: MS4wfJnFC8GP6QIBrt6FX5O3FRVjIZ6X3bPuiCXcLGzLWIOWvZUypxLGjkgZEOO6UanAWLenNK9c0c+9SLA3RBofLAxt/9tPy/qCLyeLJxxw5qtixHTrVq7u 5EPa7L4+LV+JrCuYZLv1Er4XPbahICp6Mnburvbr+XbIumRO5PJf7drGeIupg2jZyPIpYyfym/mgFQ== Subject: [FFmpeg-devel] [PATCH] avcodec/qpeldsp: copy less for the mc0x cases X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: X96GN2OTSK81 Fixes: out of array access Fixes: 47936/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5745039940124672 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/qpeldsp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/qpeldsp.c b/libavcodec/qpeldsp.c index 2b9146ceb1..5f937f9d9e 100644 --- a/libavcodec/qpeldsp.c +++ b/libavcodec/qpeldsp.c @@ -199,7 +199,7 @@ static void OPNAME ## qpel8_mc01_c(uint8_t *dst, const uint8_t *src, \ uint8_t full[16 * 9]; \ uint8_t half[64]; \ \ - copy_block9(full, src, 16, stride, 9); \ + copy_block8(full, src, 16, stride, 9); \ put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16); \ OPNAME ## pixels8_l2_8(dst, full, half, stride, 16, 8, 8); \ } \ @@ -209,7 +209,7 @@ static void OPNAME ## qpel8_mc02_c(uint8_t *dst, const uint8_t *src, \ { \ uint8_t full[16 * 9]; \ \ - copy_block9(full, src, 16, stride, 9); \ + copy_block8(full, src, 16, stride, 9); \ OPNAME ## mpeg4_qpel8_v_lowpass(dst, full, stride, 16); \ } \ \ @@ -219,7 +219,7 @@ static void OPNAME ## qpel8_mc03_c(uint8_t *dst, const uint8_t *src, \ uint8_t full[16 * 9]; \ uint8_t half[64]; \ \ - copy_block9(full, src, 16, stride, 9); \ + copy_block8(full, src, 16, stride, 9); \ put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16); \ OPNAME ## pixels8_l2_8(dst, full + 16, half, stride, 16, 8, 8); \ } \ @@ -459,7 +459,7 @@ static void OPNAME ## qpel16_mc01_c(uint8_t *dst, const uint8_t *src, \ uint8_t full[24 * 17]; \ uint8_t half[256]; \ \ - copy_block17(full, src, 24, stride, 17); \ + copy_block16(full, src, 24, stride, 17); \ put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24); \ OPNAME ## pixels16_l2_8(dst, full, half, stride, 24, 16, 16); \ } \ @@ -469,7 +469,7 @@ static void OPNAME ## qpel16_mc02_c(uint8_t *dst, const uint8_t *src, \ { \ uint8_t full[24 * 17]; \ \ - copy_block17(full, src, 24, stride, 17); \ + copy_block16(full, src, 24, stride, 17); \ OPNAME ## mpeg4_qpel16_v_lowpass(dst, full, stride, 24); \ } \ \ @@ -479,7 +479,7 @@ static void OPNAME ## qpel16_mc03_c(uint8_t *dst, const uint8_t *src, \ uint8_t full[24 * 17]; \ uint8_t half[256]; \ \ - copy_block17(full, src, 24, stride, 17); \ + copy_block16(full, src, 24, stride, 17); \ put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24); \ OPNAME ## pixels16_l2_8(dst, full + 24, half, stride, 24, 16, 16); \ } \