Commit e6b6ae46 authored by Michael Niedermayer's avatar Michael Niedermayer

vorbisdec: check codebook entry count

Fixes assertion failure

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 3a4c8788
......@@ -422,6 +422,11 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
}
// Initialize VLC table
if (entries <= 0) {
av_log(vc->avctx, AV_LOG_ERROR, "Invalid codebook entry count\n");
ret = AVERROR_INVALIDDATA;
goto error;
}
if (ff_vorbis_len2vlc(tmp_vlc_bits, tmp_vlc_codes, entries)) {
av_log(vc->avctx, AV_LOG_ERROR, " Invalid code lengths while generating vlcs. \n");
ret = AVERROR_INVALIDDATA;
......
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