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 B82324AAA2 for ; Thu, 11 Jul 2024 23:34:56 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8FC4D68DB5F; Fri, 12 Jul 2024 02:34:29 +0300 (EEST) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 974A468DB3F for ; Fri, 12 Jul 2024 02:34:21 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id CDAF3E0003 for ; Thu, 11 Jul 2024 23:34:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720740861; 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: in-reply-to:in-reply-to:references:references; bh=jMrjgOmP53SwpnuR6orpL4rUv0/QD2/mbpjxdNFAx+s=; b=pW6FaKo0xgUYgbIMO+r0yZwo/wUCBWaK5+9dAMo7/PWJqkUZEeCxiQym8Kj9GSrIKqwksr wTZm1m+ECRzUAzhP2FsRJVYKMFKmEzLQQpNcd7+Ax4yocHyVP7U9Rbv2YQXx8oXm1b0lM6 frXhjCa77BRwqZR86NmUfymF0S9eBEFHMSl2XikfwRJJZOCGp+wF78m7fslLFE4aTmhrFj q69D3vUGuQtJ8XnDgOc9gqIePn9XpK5r+5oGjPw5N+TgwA9anZn7xGEX9pkoyLg/0dDi09 GtOBQoqaUBghTQkTljWNoo7xXYY/DrpKap/zZhOY/iMx9FvdKwSKZgMZBP1oAA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 12 Jul 2024 01:33:58 +0200 Message-ID: <20240711233417.1896879-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711233417.1896879-1-michael@niedermayer.cc> References: <20240711233417.1896879-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 04/22] avformat/hnm: Check *chunk_size 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: CID1604419 Overflowed constant Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavformat/hnm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/hnm.c b/libavformat/hnm.c index 42efaaa3e8b..425dadc5e31 100644 --- a/libavformat/hnm.c +++ b/libavformat/hnm.c @@ -114,6 +114,8 @@ static int hnm_read_packet(AVFormatContext *s, AVPacket *pkt) if (hnm->superchunk_remaining == 0) { /* parse next superchunk */ superchunk_size = avio_rl24(pb); + if (superchunk_size < 4) + return AVERROR_INVALIDDATA; avio_skip(pb, 1); hnm->superchunk_remaining = superchunk_size - 4; @@ -124,7 +126,7 @@ static int hnm_read_packet(AVFormatContext *s, AVPacket *pkt) chunk_id = avio_rl16(pb); avio_skip(pb, 2); - if (chunk_size > hnm->superchunk_remaining || !chunk_size) { + if (chunk_size > hnm->superchunk_remaining || chunk_size < 8) { av_log(s, AV_LOG_ERROR, "invalid chunk size: %"PRIu32", offset: %"PRId64"\n", chunk_size, avio_tell(pb)); -- 2.45.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".