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 F0CB240A27 for ; Sat, 25 Dec 2021 10:43:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 803E268B0EB; Sat, 25 Dec 2021 12:43:14 +0200 (EET) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 199A568B098 for ; Sat, 25 Dec 2021 12:43:07 +0200 (EET) Received: from localhost (213-47-68-29.cable.dynamic.surfer.at [213.47.68.29]) (Authenticated sender: michael@niedermayer.cc) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 38C9B60002 for ; Sat, 25 Dec 2021 10:43:05 +0000 (UTC) Date: Sat, 25 Dec 2021 11:43:05 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20211225104305.GR2829255@pb2> References: <20211223211527.20408-1-michael@niedermayer.cc> <20211223211527.20408-2-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 2/5] avcodec/cdgraphics: avoid signed overflow in alpha 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="===============4055226574064527783==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4055226574064527783== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hTRmkfKs14qR7Kmf" Content-Disposition: inline --hTRmkfKs14qR7Kmf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 23, 2021 at 10:45:47PM +0100, Andreas Rheinhardt wrote: > Michael Niedermayer: > > Fixes: left shift of 255 by 24 places cannot be represented in type 'in= t' > > Fixes: 42766/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CDGRAPHI= CS_fuzzer-5142826105569280 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/cdgraphics.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c > > index 06f83920943..f54ce5a05c0 100644 > > --- a/libavcodec/cdgraphics.c > > +++ b/libavcodec/cdgraphics.c > > @@ -122,7 +122,7 @@ static void cdg_load_palette(CDGraphicsContext *cc,= uint8_t *data, int low) > > r =3D ((color >> 8) & 0x000F) * 17; > > g =3D ((color >> 4) & 0x000F) * 17; > > b =3D ((color ) & 0x000F) * 17; > > - palette[i + array_offset] =3D cc->alpha[i + array_offset] << 2= 4 | r << 16 | g << 8 | b; > > + palette[i + array_offset] =3D (unsigned)cc->alpha[i + array_of= fset] << 24 | r << 16 | g << 8 | b; > > } > > cc->frame->palette_has_changed =3D 1; > > } > >=20 >=20 > LGTM. Although I'd prefer uint32_t here, as this is exactly what is > needed and it fits the type of palette. will apply32_t thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I do not agree with what you have to say, but I'll defend to the death your right to say it. -- Voltaire --hTRmkfKs14qR7Kmf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYcb1tQAKCRBhHseHBAsP q46iAKCOV9PlHJ/89elaScBFvPu2550ZlQCfVAW9DKYoP+pAjXzT9r+QUxcKtd8= =zoyD -----END PGP SIGNATURE----- --hTRmkfKs14qR7Kmf-- --===============4055226574064527783== 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". --===============4055226574064527783==--