diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-11 00:54:12 +0100 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-05-09 11:20:11 +0200 |
commit | d86a5ce03f6993aaf7a28f2c2b29a788d7ea76ab (patch) | |
tree | 4719dc9c75cda33c309394719747c9cb1539fd57 /libavcodec | |
parent | c313f3160ae18ada6b075cbe7a891ea076d1f8d3 (diff) | |
download | ffmpeg-d86a5ce03f6993aaf7a28f2c2b29a788d7ea76ab.tar.gz |
vorbisdec: Error on bark_map_size equal to 0.
The value is used to calculate output LSP curve and a division by zero
and out of array accesses would occur.
CVE-2013-0894
CC: libav-stable@libav.org
Reported-by: Dale Curtis <dalecurtis@chromium.org>
Found-by: inferno@chromium.org
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 11dcecfcca0eca1a571792c4fa3c21fb2cfddddc)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 494ddd377ada76ed555f7a3f49391455daa099c9)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavcodec')
-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 3805d27627..790abb6111 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -572,6 +572,11 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) floor_setup->data.t0.order = get_bits(gb, 8); floor_setup->data.t0.rate = get_bits(gb, 16); floor_setup->data.t0.bark_map_size = get_bits(gb, 16); + if (floor_setup->data.t0.bark_map_size == 0) { + av_log(vc->avccontext, AV_LOG_ERROR, + "Floor 0 bark map size is 0.\n"); + return AVERROR_INVALIDDATA; + } floor_setup->data.t0.amplitude_bits = get_bits(gb, 6); /* zero would result in a div by zero later * * 2^0 - 1 == 0 */ |