diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2012-09-28 14:38:13 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-02-10 18:01:15 +0100 |
commit | 5235db68c062581b8625b4a432d96101f1a23f44 (patch) | |
tree | 30001f5cc763129a4c42a00f9b067f3435f228f2 | |
parent | 6731776795a8f7e60991c6185480043a2b94a7ab (diff) | |
download | ffmpeg-5235db68c062581b8625b4a432d96101f1a23f44.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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index e7bbd5d541..c95a571f72 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -173,7 +173,7 @@ 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; |