aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vorbisdec.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-02-24 12:30:30 +0100
committerLuca Barbato <lu_zero@gentoo.org>2013-02-25 07:34:00 +0100
commit5b47c19bfda92273ae49e83db26a565afcaed80a (patch)
tree093c5a9563a74fd30cfa8c3ab7e0c1887fea34e1 /libavcodec/vorbisdec.c
parentfc386f2eea8d93ecd4f81e1646c835d1645c56a0 (diff)
downloadffmpeg-5b47c19bfda92273ae49e83db26a565afcaed80a.tar.gz
vorbisdec: Add missing checks
Rate and order must not be 0 even if the specification does not say that explicitly.
Diffstat (limited to 'libavcodec/vorbisdec.c')
-rw-r--r--libavcodec/vorbisdec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index 9200ca0d0a..7575ee4181 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -584,7 +584,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);
if (!floor_setup->data.t0.bark_map_size) {
av_log(vc->avccontext, AV_LOG_ERROR,