]> git.sesse.net Git - ffmpeg/commitdiff
vorbisdec: Add missing checks
authorLuca Barbato <lu_zero@gentoo.org>
Sun, 24 Feb 2013 11:30:30 +0000 (12:30 +0100)
committerLuca Barbato <lu_zero@gentoo.org>
Mon, 25 Feb 2013 06:34:00 +0000 (07:34 +0100)
Rate and order must not be 0 even if the specification does not say that
explicitly.

libavcodec/vorbisdec.c

index 9200ca0d0acf979d435373e48a992f9529f2b1ea..7575ee4181917a001f30dbcdff5bffcdd2e318be 100644 (file)
@@ -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,