mpegaudiodec: fix short_start calculation
authorLuca Barbato <lu_zero@gentoo.org>
Fri, 28 Sep 2012 12:38:13 +0000 (14:38 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Fri, 28 Sep 2012 14:02:39 +0000 (16:02 +0200)
The value should be always 3, as it follows from the specification.

Fix a stack buffer overflow in exponents_from_scale_factors as reported
by asan. Thanks to Dale Curtis for the sample vector.

libavcodec/mpegaudiodec.c

index 03094f6..ead0e1d 100644 (file)
@@ -211,7 +211,7 @@ static void ff_compute_band_indexes(MPADecodeContext *s, GranuleDef *g)
             else
                 g->long_end = 6;
 
-            g->short_start = 2 + (s->sample_rate_index != 8);
+            g->short_start = 3;
         } else {
             g->long_end    = 0;
             g->short_start = 0;