aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2012-09-28 14:38:13 +0200
committerReinhard Tartler <siretart@tauware.de>2012-10-19 19:23:14 +0200
commit0f3381ad5bff4c21ba8631fcb54e7e26b6a96803 (patch)
treec91f8cb1e18f9374a36fd7c0953c212886545bc0
parent9822e3aa52d1f074cbf0577e255fcb706b7e6fd4 (diff)
downloadffmpeg-0f3381ad5bff4c21ba8631fcb54e7e26b6a96803.tar.gz
mpegaudiodec: fix short_start calculation
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. (cherry picked from commit 97cfa55eea39cef30abe14682c56c1e4e7f6f10d) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r--libavcodec/mpegaudiodec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index d90257303c..bb1baef2c9 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -208,7 +208,7 @@ static void ff_compute_band_indexes(MPADecodeContext *s, GranuleDef *g)
else
g->long_end = 4; /* 8000 Hz */
- g->short_start = 2 + (s->sample_rate_index != 8);
+ g->short_start = 3;
} else {
g->long_end = 0;
g->short_start = 0;