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

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


Alternative to 8fc649b931a3cbc3a2dd9b50b75a9261a2fb4b49.

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

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] &&
-- 
2.40.1



More information about the ffmpeg-devel mailing list