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 E7EC84819E for ; Sun, 12 Nov 2023 00:40:46 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CD96368CBF0; Sun, 12 Nov 2023 02:40:42 +0200 (EET) Received: from mx.sdf.org (mx.sdf.org [205.166.94.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9304A68CA46 for ; Sun, 12 Nov 2023 02:40:36 +0200 (EET) Received: from d5ab65435edfd8f9f61ded3900a4d560 ([1.152.212.128]) (authenticated (0 bits)) by mx.sdf.org (8.16.1/8.14.5) with ESMTPSA id 3AC0eTCY019302 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for ; Sun, 12 Nov 2023 00:40:33 GMT Date: Sun, 12 Nov 2023 11:40:26 +1100 From: Peter Ross To: ffmpeg-devel@ffmpeg.org Message-ID: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] lead: support unaligned blocks 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="===============4412456175109637224==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4412456175109637224== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sNMJS9P1DFVDmv6+" Content-Disposition: inline --sNMJS9P1DFVDmv6+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Fixed ticket #10656. --- libavcodec/leaddec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/leaddec.c b/libavcodec/leaddec.c index ede52fba5a..fd2018256d 100644 --- a/libavcodec/leaddec.c +++ b/libavcodec/leaddec.c @@ -192,8 +192,8 @@ static int lead_decode_frame(AVCodecContext *avctx, AVF= rame * frame, init_get_bits8(&gb, s->bitstream_buf, size); =20 if (avctx->pix_fmt =3D=3D AV_PIX_FMT_YUV420P) { - for (int mb_y =3D 0; mb_y < avctx->height / 16; mb_y++) - for (int mb_x =3D 0; mb_x < avctx->width / 16; mb_x++) + for (int mb_y =3D 0; mb_y < (avctx->height + 15) / 16; mb_y++) + for (int mb_x =3D 0; mb_x < (avctx->width + 15) / 16; mb_x++) for (int b =3D 0; b < (yuv20p_half ? 4 : 6); b++) { int luma_block =3D yuv20p_half ? 2 : 4; const VLCElem * dc_vlc =3D b < luma_block ? luma_dc_vl= c.table : chroma_dc_vlc.table; @@ -225,8 +225,8 @@ static int lead_decode_frame(AVCodecContext *avctx, AVF= rame * frame, } } else { for (int f =3D 0; f < fields; f++) - for (int j =3D 0; j < avctx->height / fields / 8; j++) - for (int i =3D 0; i < avctx->width / 8; i++) + for (int j =3D 0; j < (avctx->height + 7) / fields / 8; j++) + for (int i =3D 0; i < (avctx->width + 7) / 8; i++) for (int plane =3D 0; plane < 3; plane++) { const VLCElem * dc_vlc =3D !plane ? luma_dc_vlc.ta= ble : chroma_dc_vlc.table; int dc_bits =3D !plane ? LUMA_DC_BITS := CHROMA_DC_BITS; --=20 2.42.0 -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) --sNMJS9P1DFVDmv6+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSpB+AvpuUM0jTNINJnYHnFrEDdawUCZVAe9gAKCRBnYHnFrEDd a8E1AJ9+uGlj36ch1Mn1YFnA7+W9dOC5DQCfWuAoDBSMGGdC35hsIRUeepBfetI= =Z56T -----END PGP SIGNATURE----- --sNMJS9P1DFVDmv6+-- --===============4412456175109637224== 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". --===============4412456175109637224==--