Commit 6998af4a authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/bitstream: check codes in ff_init_vlc_sparse()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent fb3e3808
...@@ -310,6 +310,10 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, ...@@ -310,6 +310,10 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
return -1;\ return -1;\
}\ }\
GET_DATA(buf[j].code, codes, i, codes_wrap, codes_size);\ GET_DATA(buf[j].code, codes, i, codes_wrap, codes_size);\
if (buf[j].code >= (1LL<<buf[j].bits)) {\
av_log(NULL, AV_LOG_ERROR, "Invalid code in init_vlc\n");\
return -1;\
}\
if (flags & INIT_VLC_LE)\ if (flags & INIT_VLC_LE)\
buf[j].code = bitswap_32(buf[j].code);\ buf[j].code = bitswap_32(buf[j].code);\
else\ else\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment