diff options
author | Michael Niedermayer <[email protected]> | 2013-01-11 00:54:12 +0100 |
---|---|---|
committer | Reinhard Tartler <[email protected]> | 2013-02-26 20:21:01 +0100 |
commit | 494ddd377ada76ed555f7a3f49391455daa099c9 (patch) | |
tree | 54b9d02d7caa02844c311abd690767ebaa429b09 | |
parent | 37e99e384e37364fca13dc6a70111adb1c356fa2 (diff) |
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: [email protected]
Reported-by: Dale Curtis <[email protected]>
Found-by: [email protected]
Signed-off-by: Michael Niedermayer <[email protected]>
Signed-off-by: Luca Barbato <[email protected]>
(cherry picked from commit 11dcecfcca0eca1a571792c4fa3c21fb2cfddddc)
Signed-off-by: Reinhard Tartler <[email protected]>
-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 4b87ef96a4..cfa89be26c 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -597,6 +597,11 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) return AVERROR_INVALIDDATA; } 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 */ |