vorbisdec: check codebook entry count

Fixes assertion failure

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/18/head
Michael Niedermayer 12 years ago
parent 3a4c8788e3
commit e6b6ae4695
  1. 5
      libavcodec/vorbisdec.c

@ -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;

Loading…
Cancel
Save