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 0E2044099B for ; Fri, 24 Dec 2021 16:58:12 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B795B68B26C; Fri, 24 Dec 2021 18:58:09 +0200 (EET) Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8C2A368B121 for ; Fri, 24 Dec 2021 18:58:02 +0200 (EET) Received: from localhost (213-47-68-29.cable.dynamic.surfer.at [213.47.68.29]) (Authenticated sender: michael@niedermayer.cc) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 9D3CD240002 for ; Fri, 24 Dec 2021 16:58:01 +0000 (UTC) Date: Fri, 24 Dec 2021 17:58:00 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20211224165800.GN2829255@pb2> References: <20211223211527.20408-1-michael@niedermayer.cc> <20211223211527.20408-5-michael@niedermayer.cc> <08d87b86-6c41-5474-7303-9527cf6755cf@personalprojects.net> MIME-Version: 1.0 In-Reply-To: <08d87b86-6c41-5474-7303-9527cf6755cf@personalprojects.net> Subject: Re: [FFmpeg-devel] [PATCH 5/5] avformat/mvdec: Check bytes_per_sample 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="===============4514696570490176233==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4514696570490176233== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wkllOIiICJ11ZErV" Content-Disposition: inline --wkllOIiICJ11ZErV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 23, 2021 at 10:32:12PM -0500, John-Paul Stewart wrote: > On 2021-12-23 16:15, Michael Niedermayer wrote: > > Fixes: division by zero > > Fixes: 42814/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-478701= 4237552640 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavformat/mvdec.c | 3 +++ > > 1 file changed, 3 insertions(+) > >=20 > > diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c > > index 1a5012e5076..390f6ba4de8 100644 > > --- a/libavformat/mvdec.c > > +++ b/libavformat/mvdec.c > > @@ -366,6 +366,9 @@ static int mv_read_header(AVFormatContext *avctx) > > avpriv_request_sample(avctx, "Audio compression (format %i= )", v); > > } > > =20 > > + if (bytes_per_sample <=3D 0) > > + return AVERROR_INVALIDDATA; > > + >=20 > bytes_per_sample is uint32_t so it can never be less than zero. >=20 > bytes_per_sample will be zero for movie files with no audio, so that is > not necessarily invalid data. i can change it to AVERROR_PATCHWELCOME but this codepath has already created a audio stream so the code at least belives at this point that there is audio and it will crash a few lines later >=20 > I can't offer a better suggestion at the moment, though. I'll see if > can come up with something, unless one of you guys gets to it first. ok, ill apply this unless i see another fix first as it fixes the crash and in fact in this path requests for samples where already printed also thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The misfortune of the wise is better than the prosperity of the fool. -- Epicurus --wkllOIiICJ11ZErV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYcX8FQAKCRBhHseHBAsP q9ocAJ4+Hg/3w2EjC93qlc/BHe5Z9mCY2wCdFn4bb6iHbzTemdgF+Z8kgizd3BE= =06MF -----END PGP SIGNATURE----- --wkllOIiICJ11ZErV-- --===============4514696570490176233== 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". --===============4514696570490176233==--