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 9B55843AE2 for ; Tue, 12 Jul 2022 18:13:29 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B2A2D68B948; Tue, 12 Jul 2022 21:13:27 +0300 (EEST) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E11E368B922 for ; Tue, 12 Jul 2022 21:13:21 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 1BF4CE0006 for ; Tue, 12 Jul 2022 18:13:20 +0000 (UTC) Date: Tue, 12 Jul 2022 20:13:20 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220712181320.GJ396728@pb2> References: <20220626135146.13096-1-michael@niedermayer.cc> <20220627124004.GS396728@pb2> MIME-Version: 1.0 In-Reply-To: <20220627124004.GS396728@pb2> 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="===============4594086316196725888==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4594086316196725888== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="43FMArcZVs5IEe1n" Content-Disposition: inline --43FMArcZVs5IEe1n Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 27, 2022 at 02:40:04PM +0200, Michael Niedermayer wrote: > 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_= fuzzer-5745039940124672 > > >=20 > > > Found-by: continuous fuzzing process https://github.com/google/oss-fu= zz/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, = 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= ); \ > > > } = \ > >=20 > > Are the arch-specific dsp functions affected by this, too? >=20 > the fuzzer sample does not cause a anomaly in the x86 functions >=20 >=20 > > Do you happen to know why copy_block9/17 has been used in this code? >=20 > 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 either way dont want to leave this open, so will apply. If more is needed that will be fixed once we know of it thx [...] --=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. --43FMArcZVs5IEe1n Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYs25wAAKCRBhHseHBAsP q7gAAJ9H3mRGA7j7X2E5HNIqGnGam6rR9QCeLSTOh1GaDT0koJ8puGHORrNSFHg= =KwET -----END PGP SIGNATURE----- --43FMArcZVs5IEe1n-- --===============4594086316196725888== 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". --===============4594086316196725888==--