]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/g2meet: Use least max_depth in get_vlc2()
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 1 Nov 2020 01:17:43 +0000 (02:17 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 24 Nov 2020 10:35:03 +0000 (11:35 +0100)
The longest AC codes of the standard JPEG tables are 16 bits long; for
the DC tables, the maximum is 11, so using max_depth of two is
sufficient.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/g2meet.c

index 6b870ae3d44cfde8cc5576f74665c2c7b7f07aa1..f6aa636bdea1475b766fcb1c616b47791f86cff1 100644 (file)
@@ -248,7 +248,7 @@ static int jpg_decode_block(JPGContext *c, GetBitContext *gb,
         return AVERROR_INVALIDDATA;
 
     c->bdsp.clear_block(block);
-    dc = get_vlc2(gb, c->dc_vlc[is_chroma].table, 9, 3);
+    dc = get_vlc2(gb, c->dc_vlc[is_chroma].table, 9, 2);
     if (dc < 0)
         return AVERROR_INVALIDDATA;
     if (dc)
@@ -259,7 +259,7 @@ static int jpg_decode_block(JPGContext *c, GetBitContext *gb,
 
     pos = 0;
     while (pos < 63) {
-        val = get_vlc2(gb, c->ac_vlc[is_chroma].table, 9, 3);
+        val = get_vlc2(gb, c->ac_vlc[is_chroma].table, 9, 2);
         if (val < 0)
             return AVERROR_INVALIDDATA;
         pos += val >> 4;