[FFmpeg-cvslog] avcodec/vlc: Make code more readable with av_unreachable()

Andreas Rheinhardt git at videolan.org
Wed May 21 13:47:37 EEST 2025


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sun Oct  3 15:18:45 2021 +0200| [d7d1379d06e5d4865fab85640277ef51c4ef22bd] | committer: Andreas Rheinhardt

avcodec/vlc: Make code more readable with av_unreachable()

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d7d1379d06e5d4865fab85640277ef51c4ef22bd
---

 libavcodec/vlc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vlc.c b/libavcodec/vlc.c
index c49c801181..f5456f73ce 100644
--- a/libavcodec/vlc.c
+++ b/libavcodec/vlc.c
@@ -42,6 +42,8 @@
 {                                                           \
     const uint8_t *ptr = (const uint8_t *)table + i * wrap; \
     switch(size) {                                          \
+    default:                                                \
+        av_unreachable("Only uint8/16/32_t are used");      \
     case 1:                                                 \
         v = *(const uint8_t *)ptr;                          \
         break;                                              \
@@ -49,8 +51,6 @@
         v = *(const uint16_t *)ptr;                         \
         break;                                              \
     case 4:                                                 \
-    default:                                                \
-        av_assert1(size == 4);                              \
         v = *(const uint32_t *)ptr;                         \
         break;                                              \
     }                                                       \



More information about the ffmpeg-cvslog mailing list