diff mbox series

[FFmpeg-devel,05/12] avcodec/mpeg4videodec: Mark impossible switch case as unreachable

Message ID AS8P250MB0744D651664318083BB3048C8FF52@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 to 8fc649b931a3cbc3a2dd9b50b75a9261a2fb4b49.

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

Patch

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index df1e22207d..724ca202f5 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -24,6 +24,7 @@ 
 
 #include "config_components.h"
 
+#include "libavutil/avassert.h"
 #include "libavutil/internal.h"
 #include "libavutil/opt.h"
 #include "libavutil/thread.h"
@@ -598,7 +599,10 @@  static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
         ctx->sprite_shift[1]  = alpha + beta + rho - min_ab + 2;
         break;
     default:
-        av_assert0(0);
+        /* num_sprite_warping_points outside of 0..3 results in an error
+         * in which num_sprite_warping_points is reset to zero. */
+        av_unreachable;
+        break;
     }
     /* try to simplify the situation */
     if (sprite_delta[0][0] == a << ctx->sprite_shift[0] &&