From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 4176E432B3 for ; Mon, 27 Jun 2022 12:40:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 71C8B68B8AC; Mon, 27 Jun 2022 15:40:13 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EFC7268B862 for ; Mon, 27 Jun 2022 15:40:06 +0300 (EEST) Received: from localhost (213-47-68-29.cable.dynamic.surfer.at [213.47.68.29]) (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id DAA90C0003 for ; Mon, 27 Jun 2022 12:40:05 +0000 (UTC) Date: Mon, 27 Jun 2022 14:40:04 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220627124004.GS396728@pb2> References: <20220626135146.13096-1-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: Subject: Re: [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 Content-Type: multipart/mixed; boundary="===============4803792330414422940==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4803792330414422940== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kzYXZHgCPYPq2Gwn" Content-Disposition: inline --kzYXZHgCPYPq2Gwn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 27, 2022 at 07:57:06AM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > Fixes: out of array access > > Fixes: 47936/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fu= zzer-5745039940124672 > >=20 > > 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(-) > >=20 > > 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, co= nst 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, co= nst 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, co= nst 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, c= onst 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, c= onst 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, c= onst 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);= \ > > } = \ >=20 > Are the arch-specific dsp functions affected by this, too? the fuzzer sample does not cause a anomaly in the x86 functions > Do you happen to know why copy_block9/17 has been used in this code? probably because there was asm anyway so it was unused code or maybe it was oversight or some sort of code sharing/code cache use reduction but these hypothesis dont fit entirely. so i dont really know/rememeber > (After all, using copy_block8/16 should result in a slight speedup, so I > using copy_block9/17 must have been intentional.) [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Homeopathy is like voting while filling the ballot out with transparent ink. Sometimes the outcome one wanted occurs. Rarely its worse than filling out a ballot properly. --kzYXZHgCPYPq2Gwn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYrmlIQAKCRBhHseHBAsP q5q7AJ96lm5YicwW64Y+gIp99iNktchyHACfQc2SfnbSx4n4q1PQNUCvJM2XWB8= =2FZR -----END PGP SIGNATURE----- --kzYXZHgCPYPq2Gwn-- --===============4803792330414422940== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --===============4803792330414422940==--