diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c index 4ce49fd51c..7570fb2204 100644 --- a/libavcodec/bitstream.c +++ b/libavcodec/bitstream.c @@ -281,9 +281,9 @@ static int vlc_common_end(VLC *vlc, int nb_bits, int nb_codes, VLCcode *codes, int ret = build_table(vlc, nb_bits, nb_codes, codes, flags); if (flags & INIT_VLC_USE_NEW_STATIC) { - if(vlc->table_size != vlc->table_allocated) + if (vlc->table_size != vlc->table_allocated && + !(flags & (INIT_VLC_STATIC_OVERLONG & ~INIT_VLC_USE_NEW_STATIC))) av_log(NULL, AV_LOG_ERROR, "needed %d had %d\n", vlc->table_size, vlc->table_allocated); - av_assert0(ret >= 0); *vlc_arg = *vlc; } else { diff --git a/libavcodec/vlc.h b/libavcodec/vlc.h index 50a1834b84..6879c3ca6a 100644 --- a/libavcodec/vlc.h +++ b/libavcodec/vlc.h @@ -93,6 +93,7 @@ void ff_free_vlc(VLC *vlc); #define INIT_VLC_OUTPUT_LE 8 #define INIT_VLC_LE (INIT_VLC_INPUT_LE | INIT_VLC_OUTPUT_LE) #define INIT_VLC_USE_NEW_STATIC 4 +#define INIT_VLC_STATIC_OVERLONG (1 | INIT_VLC_USE_NEW_STATIC) #define INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, \ h, i, j, flags, static_size) \