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

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sat May 25 01:04:45 EEST 2024


Alternative fix for Coverity issue #1473499
instead of a3bb269db92601e2dc0e99352468d02f7b26c7c2.

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

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);
-- 
2.40.1



More information about the ffmpeg-devel mailing list