summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <[email protected]>2013-02-24 12:30:30 +0100
committerReinhard Tartler <[email protected]>2013-02-26 20:21:01 +0100
commit37e99e384e37364fca13dc6a70111adb1c356fa2 (patch)
treed50e899b413a9e4aedcdd6c344b7282368f39d10
parent73d6f4651e64846c9a279357c158a32c6ffbd4f7 (diff)
vorbisdec: Add missing checks
Rate and order must not be 0 even if the specification does not say that explicitly. (cherry picked from commit 5b47c19bfda92273ae49e83db26a565afcaed80a) Signed-off-by: Reinhard Tartler <[email protected]>
-rw-r--r--libavcodec/vorbisdec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index aac9019ed6..4b87ef96a4 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -585,7 +585,17 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
floor_setup->decode = vorbis_floor0_decode;
floor_setup->data.t0.order = get_bits(gb, 8);
+ if (!floor_setup->data.t0.order) {
+ av_log(vc->avccontext, AV_LOG_ERROR,
+ "Floor 0 order is 0.\n");
+ return AVERROR_INVALIDDATA;
+ }
floor_setup->data.t0.rate = get_bits(gb, 16);
+ if (!floor_setup->data.t0.rate) {
+ av_log(vc->avccontext, AV_LOG_ERROR,
+ "Floor 0 rate is 0.\n");
+ return AVERROR_INVALIDDATA;
+ }
floor_setup->data.t0.bark_map_size = get_bits(gb, 16);
floor_setup->data.t0.amplitude_bits = get_bits(gb, 6);
/* zero would result in a div by zero later *