From da05e644ba3f3e7b44e13c2ec36823fbe783db23 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Sun, 3 Oct 2021 14:35:31 +0200 Subject: [PATCH 04/21] avcodec/mpeg4videodec: Mark impossible switch case as unreachable Alternative to 8fc649b931a3cbc3a2dd9b50b75a9261a2fb4b49. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg4videodec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index e21f1d24a2..45087f3650 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" @@ -605,7 +606,9 @@ 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); + av_unreachable("num_sprite_warping_points outside of 0..3 results in an error" + "in which num_sprite_warping_points is reset to zero"); + break; } /* try to simplify the situation */ if (sprite_delta[0][0] == a << ctx->sprite_shift[0] && -- 2.45.2