diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-05-13 14:19:57 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-05-13 14:27:35 +0200 |
commit | e6b6ae46951e242d7caf11acf5b1f10f109e1c96 (patch) | |
tree | 2ea3d1a24c40f65b470fb5aec88245edcbed4d00 | |
parent | 3a4c8788e3239e5ff89ed0aea7f4936bd6e62032 (diff) | |
download | ffmpeg-e6b6ae46951e242d7caf11acf5b1f10f109e1c96.tar.gz |
vorbisdec: check codebook entry count
Fixes assertion failure
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/vorbisdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index f30745d7ae..ba5b1a3f94 100644 --- a/libavcodec/vorbisdec.c +++ b/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; |