From ee762046a00e5fe501dabdbb9ba757c2bb597766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Cartegnie?= Date: Wed, 9 Oct 2024 14:11:33 +0700 Subject: [PATCH] aout: use static assert for fallbacks --- src/audio_output/output.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/audio_output/output.c b/src/audio_output/output.c index 7fbb5a750b27..6c5f577834bf 100644 --- a/src/audio_output/output.c +++ b/src/audio_output/output.c @@ -747,10 +747,10 @@ int aout_OutputNew(audio_output_t *aout, vlc_aout_stream *stream, { switch (fmt->i_format) { + static_assert(ARRAY_SIZE(formats) >= 3, "fallback array too small"); case VLC_CODEC_DTS: if (input_profile > 0) { - assert(ARRAY_SIZE(formats) >= 3); /* DTSHD can be played as DTSHD or as DTS */ formats[0] = VLC_CODEC_DTSHD; formats[1] = VLC_CODEC_DTS; @@ -759,7 +759,6 @@ int aout_OutputNew(audio_output_t *aout, vlc_aout_stream *stream, case VLC_CODEC_A52: if (input_profile > 0) { - assert(ARRAY_SIZE(formats) >= 3); formats[0] = VLC_CODEC_EAC3; formats[1] = VLC_CODEC_A52; }