PR #23836 opened by qaq03101
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23836
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23836.patch

# Summary of changes\n\nReject SCD tracks with zero channels, which can cause a 
division by zero in \u0060scd_read_packet()\u0060.\n\nFixes #23181.


>From 64734e415c09eaab82cc5ad2c9baf52af8513203 Mon Sep 17 00:00:00 2001
From: qaq03101 <[email protected]>
Date: Fri, 17 Jul 2026 14:05:55 +0800
Subject: [PATCH] avformat/scd: reject zero-channel tracks

A zero channel count can cause a division by zero in
scd_read_packet().

Fixes #23181.
---
 libavformat/scd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/scd.c b/libavformat/scd.c
index 091d20824c..6c0c41486d 100644
--- a/libavformat/scd.c
+++ b/libavformat/scd.c
@@ -182,7 +182,8 @@ static int scd_read_track(AVFormatContext *s, 
SCDTrackHeader *track, int index)
     track->aux_count    = AV_RB32(buf + 28);
 
     /* Sanity checks */
-    if (track->num_channels > 8 || track->sample_rate >= 192000 ||
+    if (!track->num_channels || track->num_channels > 8 ||
+        track->sample_rate >= 192000 ||
         track->loop_start > track->loop_end)
         return AVERROR_INVALIDDATA;
 
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to