diff mbox series

[FFmpeg-devel,02/12] avcodec/amrwbdec: Mark default switch as unreachable

Message ID AS8P250MB07445401C732F87F001D91E38FF52@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State New
Headers show
Series [FFmpeg-devel,01/12] avutil/avassert: Add av_unreachable and av_assume() macros | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt May 24, 2024, 10:04 p.m. UTC
Alternative fix for Coverity issue #1473499
instead of a3bb269db92601e2dc0e99352468d02f7b26c7c2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/amrwbdec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index 21a730b835..de1e661f2f 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -556,7 +556,9 @@  static void decode_fixed_vector(float *fixed_vector, const uint16_t *pulse_hi,
                            ((int) pulse_hi[i] << 11), 4, 1);
         break;
     default:
-        av_assert2(0);
+        /* Everything >= MODE_SIM is impossible: MODE_SIM is patchwelcome,
+         * > MODE_SIM is invalid. */
+        av_unreachable;
     }
 
     memset(fixed_vector, 0, sizeof(float) * AMRWB_SFR_SIZE);