aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-11 00:54:12 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-06-23 15:14:40 +0200
commit0916d0f9d1b94b4bb88382edae45b9276746574d (patch)
treed209b17e7ea46269b779ef04e6e0df6891325e00
parent66c927d2172a59b5cd056c0e87d7b232b1e44d53 (diff)
downloadffmpeg-0916d0f9d1b94b4bb88382edae45b9276746574d.tar.gz
vorbisdec: Check bark_map_size.
This fixes potential divisions by zero and out of array accesses. Reported-by: Dale Curtis <dalecurtis@chromium.org> Found-by: inferno@chromium.org Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 2c16bf2de07c68513072bf3cc96401d2c6291a3e) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/vorbisdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index 8ce0fc7c83..0ea73d5183 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -599,6 +599,10 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
"Floor 0 amplitude bits is 0.\n");
return AVERROR_INVALIDDATA;
}
+ 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_offset = get_bits(gb, 8);
floor_setup->data.t0.num_books = get_bits(gb, 4) + 1;