From 1857cf2ceb5b37acf9e07f4c99936bca8460a4bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Cartegnie?= Date: Mon, 12 Jan 2026 15:46:45 +0100 Subject: [PATCH] demux: mp4: check raw audio channels count refs #29540 --- modules/demux/mp4/essetup.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c index e6d5413860..07edd256db 100644 --- a/modules/demux/mp4/essetup.c +++ b/modules/demux/mp4/essetup.c @@ -1369,6 +1369,10 @@ int SetupAudioES( demux_t *p_demux, const mp4_track_t *p_track, if (p_SA3D && BOXDATA(p_SA3D)) p_fmt->audio.channel_type = AUDIO_CHANNEL_TYPE_AMBISONICS; + /* Sanity check for raw audio */ + if( aout_BitsPerSample(p_fmt->i_codec) && p_soun->i_channelcount == 0 ) + return 0; + return 1; }