From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id A50414EAD6 for ; Sun, 13 Jul 2025 11:42:39 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id ADDE968DD99; Sun, 13 Jul 2025 14:42:34 +0300 (EEST) Received: from btbn.de (btbn.de [144.76.60.213]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id D5AD768DCEE for ; Sun, 13 Jul 2025 14:42:27 +0300 (EEST) Received: from [authenticated] by btbn.de (Postfix) with ESMTPSA id B39E428191023 for ; Sun, 13 Jul 2025 13:42:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothenpieler.org; s=mail; t=1752406946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lYKS2ZrwjbDYSCxVtmNvcgGfTWSNDVPgiNR6qlY8qNI=; b=mg5ih7bwJk6R3z3N0k3xGWN3C4uWkM7KhmlBgnbc0QvqLWi2fAQDCIvs7U3n8cnbnGWimp sAniho58rFkz/62Fqbx5ZZeDW4PvUU66vtnKJ6xMQu4ONph1B/JDhkfYNE5g7vPitv9mso bcVHVDXiYZneO4Dc1h5eoe85oXmlOreIMcFQT1bQk4hZxCe0iETPrdoOgEkiEYZ+1qxxxX WzvkyOoL1+m7LxTVLt/LKI2j4XJGdycL9QuKLqxqBLz9kzDLiA1q+aF8uaH+Et/ngr41dq kA8MYMCQ/IAp3f2R1ZanjqGfkZyvAgSQg00pKtJd91LjW4RFpsuE+zp60rPSHQ== Message-ID: Date: Sun, 13 Jul 2025 13:42:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20250713011030.1156550-1-michael@niedermayer.cc> Content-Language: en-US From: Timo Rothenpieler In-Reply-To: <20250713011030.1156550-1-michael@niedermayer.cc> Subject: Re: [FFmpeg-devel] [PATCH 1/5] avformat/flvdec: Check for EOF in AudioPacketTypeMultichannelConfig 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 7/13/2025 3:10 AM, Michael Niedermayer wrote: > Fixes: Infinite loop > Fixes: 427538726/clusterfuzz-testcase-minimized-ffmpeg_dem_FLV_fuzzer-6582567304495104 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavformat/flvdec.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c > index ac681954cb7..a4fa0157512 100644 > --- a/libavformat/flvdec.c > +++ b/libavformat/flvdec.c > @@ -1715,6 +1715,9 @@ retry_duration: > > av_log(s, AV_LOG_DEBUG, "Set channel data from MultiChannel info.\n"); > > + if (avio_feof(s->pb)) > + return AVERROR_EOF; > + > goto next_track; > } > } else if (stream_type == FLV_STREAM_TYPE_VIDEO) { I don't think just returning from here is correct. The goto next_track right after it already checks for EOF. I do not see how between here and the eof check there there'd be any way to infinite loop. It returns FFERROR_REDO there, which is important to drain queued up packages. The next time a call hits flv_read_packet will then immediately return AVERROR_EOF, since it's one of the first things the function checks. So just throwing in a random AVERROR_EOF there seems incorrect to me, and is only hiding an actual issue elsewhere, if there is one. _______________________________________________ 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".