]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/smacker: Don't warn for Huffmann tables with one element
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 25 Jul 2020 05:21:49 +0000 (07:21 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 17 Sep 2020 23:09:25 +0000 (01:09 +0200)
The Huffmann tables used by Smacker can consist of exactly one leaf only
in which case the length of the corresponding code is zero; there is
then exactly one value encoded. Our VLC can't handle this and therefore
this case needs to be treated separately; it has been implemented in
commit 48cbdaea157671d456750e00fde37c6d7595fad6. Yet said commit also
made the decoder emit an error message (despite not erroring out) in this
case, although it seems that this is rather a limitation of our VLC API.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/smacker.c

index e53183318e2d955e0a3927a4f4a7d2a78504bbf6..3c9f118fb7b8299930c8bcb6b5f026de3a393493 100644 (file)
@@ -229,8 +229,7 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int
                 goto error;
             }
         }
-    }
-    if (!vlc[0].table) {
+    } else {
         av_log(smk->avctx, AV_LOG_ERROR, "Skipping low bytes tree\n");
     }
     if(get_bits1(gb)){
@@ -250,8 +249,7 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int
                 goto error;
             }
         }
-    }
-    if (!vlc[1].table) {
+    } else {
         av_log(smk->avctx, AV_LOG_ERROR, "Skipping high bytes tree\n");
     }