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 8B7B14A3F8 for ; Tue, 30 Apr 2024 00:49:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2A66468D570; Tue, 30 Apr 2024 03:49:02 +0300 (EEST) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D735668D55D for ; Tue, 30 Apr 2024 03:48:55 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 34955FF803 for ; Tue, 30 Apr 2024 00:48:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714438135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ZbDNdbrsvRR1CojTzN1UcRO3HgJa582C7dCLXva3/s4=; b=D2YU17/eVg60sIhsdEg8CCEdhupDhzGLNeLtaHRudj7nKCnLp2c4UGVgU1lj0gj7fK8P+1 Hymh9qwZtjs/Ya7IShWmwO0rvqIeJE2NLRqPTJdgeEIKwjCKGJFqDHTitQS7k+M3ye6HQL SOgDkNrowxGyh47W9Bscvr6IxID5xqZdulRFiZkjSPV3n1VYS+91L3Lxt2DB6nG/dl1lw+ 0hpQ3mTIaK1VNpEz6xYB4NWEHnELyM981a2I5WIfLjnUIDqdsHwL1ha7FZ0mxBo8DkMYle igrSP+EhGqib+rEW5C/PjT3rxqHmqaR7Yllz6BGwC8lCw3/XqDugxCKGzl6omw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 30 Apr 2024 02:48:52 +0200 Message-ID: <20240430004854.199741-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/3] avformat/kvag: Check sample_rate 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: Fixes: Division by 0 Fixes: -copyts -start_at_zero -itsoffset 00:00:01 -itsscale 1 -ss 00:00:02 -i zgclab/ffmpeg_crash/poc1 output.mp4 Found-by: Wang Dawei and Zhou Geng, from Zhongguancun Laboratory Signed-off-by: Michael Niedermayer --- libavformat/kvag.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/kvag.c b/libavformat/kvag.c index 1d0aee09942..b55aa893ec2 100644 --- a/libavformat/kvag.c +++ b/libavformat/kvag.c @@ -38,7 +38,7 @@ typedef struct KVAGHeader { uint32_t magic; uint32_t data_size; - uint32_t sample_rate; + int sample_rate; uint16_t stereo; } KVAGHeader; @@ -70,6 +70,9 @@ static int kvag_read_header(AVFormatContext *s) hdr.sample_rate = AV_RL32(buf + 8); hdr.stereo = AV_RL16(buf + 12); + if (hdr.sample_rate <= 0) + return AVERROR_INVALIDDATA; + par = st->codecpar; par->codec_type = AVMEDIA_TYPE_AUDIO; par->codec_id = AV_CODEC_ID_ADPCM_IMA_SSI; -- 2.43.2 _______________________________________________ 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".