]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/qdm2: Apply offsets when initializing VLCs
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 31 Oct 2020 17:23:47 +0000 (18:23 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 8 Dec 2020 16:51:46 +0000 (17:51 +0100)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/qdm2.c
libavcodec/qdm2_tablegen.h

index c3e1315ef035ed56efd20d89bb71c963e16e5ce6..118e2eac1f8cbc1e98b824d65278b4fa0be4aa5f 100644 (file)
@@ -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 */
index d91bd04dc8ed7fa17fd8e6e98819ec65f1b0a5c5..e948e9229545e3d6a2b4efb44382886f39f515b4 100644 (file)
@@ -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_LE, NULL);
+                             -1, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE, NULL);
 }
 
 static av_cold void qdm2_init_vlc(void)