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 D57FF408F0 for ; Fri, 24 Dec 2021 03:32:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B1D9F68B259; Fri, 24 Dec 2021 05:32:23 +0200 (EET) Received: from mail.personalprojects.net (mail.personalprojects.net [51.79.67.80]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 286AF68B0A8 for ; Fri, 24 Dec 2021 05:32:17 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=personalprojects.net; s=20211201; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:To:Subject:MIME-Version:Date:Message-ID:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8Lk3/2nWdnZFynwyWz9L2VMRMUOvYEYoly4Vnj7QBaQ=; b=pYImPnTBZrHp7We/gA/9FCUWLP 1A/7ZPB0LnQi1dyBQJshxH3NBbYOoyKbhLvVWu1ofUgVF1X5AM0udpzK/4bnwumOnPdW+ppHbl0IQ HTk66fBwIBWk8cCm19biwsJyjRIgxdFtLHB3a5ldzDfxP5IAFOWaUtKFe9oEKIQ0eies=; Received: from bras-base-simcon3012w-grc-05-64-231-188-105.dsl.bell.ca ([64.231.188.105] helo=[192.168.10.2]) by mail.personalprojects.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n0bJX-0001gg-L6 for ffmpeg-devel@ffmpeg.org; Thu, 23 Dec 2021 22:32:15 -0500 Message-ID: <08d87b86-6c41-5474-7303-9527cf6755cf@personalprojects.net> Date: Thu, 23 Dec 2021 22:32:12 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Content-Language: en-CA To: ffmpeg-devel@ffmpeg.org References: <20211223211527.20408-1-michael@niedermayer.cc> <20211223211527.20408-5-michael@niedermayer.cc> From: John-Paul Stewart In-Reply-To: <20211223211527.20408-5-michael@niedermayer.cc> 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 2021-12-23 16:15, Michael Niedermayer wrote: > Fixes: division by zero > Fixes: 42814/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-4787014237552640 > > 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(+) > > 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); > } > > + if (bytes_per_sample <= 0) > + return AVERROR_INVALIDDATA; > + bytes_per_sample is uint32_t so it can never be less than zero. bytes_per_sample will be zero for movie files with no audio, so that is not necessarily invalid data. 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. _______________________________________________ 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".