diff mbox series

[FFmpeg-devel,051/114] avcodec/qdm2: Apply offsets when initializing VLCs

Message ID 20201110104851.321029-52-andreas.rheinhardt@gmail.com
State Superseded
Headers show
Series VLC, esp. init_vlc patches
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Nov. 10, 2020, 10:47 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/qdm2.c          | 2 +-
 libavcodec/qdm2_tablegen.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 657b2da64d..bdfe710840 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -205,7 +205,7 @@  static int qdm2_get_vlc(GetBitContext *gb, const VLC *vlc, int flag, int depth)
     value = get_vlc2(gb, vlc->table, vlc->bits, depth);
 
     /* stage-2, 3 bits exponent escape sequence */
-    if (value-- == 0)
+    if (value < 0)
         value = get_bits(gb, get_bits(gb, 3) + 1);
 
     /* stage-3, optional */
diff --git a/libavcodec/qdm2_tablegen.h b/libavcodec/qdm2_tablegen.h
index 0e57902fc9..aaa7356caf 100644
--- a/libavcodec/qdm2_tablegen.h
+++ b/libavcodec/qdm2_tablegen.h
@@ -122,7 +122,7 @@  static av_cold void build_vlc(VLC *vlc, int nb_bits, int nb_codes, int idx,
     vlc->table_allocated = qdm2_vlc_offs[idx + 1] - qdm2_vlc_offs[idx];
     ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes,
                              &tab[0][1], 2, &tab[0][0], 2, 1,
-                             0, INIT_VLC_USE_NEW_STATIC | INIT_VLC_OUTPUT_LE);
+                             -1, INIT_VLC_USE_NEW_STATIC | INIT_VLC_OUTPUT_LE);
 }
 
 static av_cold void qdm2_init_vlc(void)