Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-13 16:19:57 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-05-13 16:27:35 +0400
commite6b6ae46951e242d7caf11acf5b1f10f109e1c96 (patch)
tree2ea3d1a24c40f65b470fb5aec88245edcbed4d00 /libavcodec/vorbisdec.c
parent3a4c8788e3239e5ff89ed0aea7f4936bd6e62032 (diff)
vorbisdec: check codebook entry count
Fixes assertion failure Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vorbisdec.c')
-rw-r--r--libavcodec/vorbisdec.c5
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;