This ensures that the number of leafs in the Huffman tree equals the
number it is supposed to be and therefore ensures that the VLC tree is
complete, allowing us to remove checks.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
if (mp_get_code(mp, gb, size, code + 1) < 0)
return AVERROR_INVALIDDATA;
}
- if (mp->current_codes_count >= MAX_HUFF_CODES) {
+ if (mp->current_codes_count >= mp->codes_count) {
av_log(mp->avctx, AV_LOG_ERROR, "too many codes\n");
return AVERROR_INVALIDDATA;
}