From 1138860d5d1785824f279268c84873f67882fc47 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 3 Nov 2026 19:44:37 +0000 Subject: [PATCH] address review: run MP4 table guard only for MP4 or unknown containers --- crates/media/src/probe.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/media/src/probe.rs b/crates/media/src/probe.rs index 2039c4c43..4de516b1f 100644 --- a/crates/media/src/probe.rs +++ b/crates/media/src/probe.rs @@ -71,7 +71,8 @@ pub fn probe_headers(bytes: &Bytes) -> Result { }; if info.audio.is_none() && info.video.is_none() || info.audio.as_ref().is_some_and(|a| a.sample_rate == 0) { // Plain audio files (and anything our demuxers didn't describe): symphonia's probe. - if !crate::mp4guard::probe_fits(bytes) { + // Known non-MP4 containers (a WAV's audio bytes can spell an `ftyp`) skip the MP4 table check. + if matches!(c, Container::Mp4 | Container::Unknown) && !crate::mp4guard::probe_fits(bytes) { return Err(MediaError::Corrupt("the MP4's sample tables do not fit the file".into())); } let (codec, rate, channels, frames) = std::panic::catch_unwind(|| crate::audio::probe_symphonia(bytes, c.name()))