summaryrefslogtreecommitdiff
path: root/libavcodec/mpegaudiodec.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2012-09-28 14:38:13 +0200
committerLuca Barbato <lu_zero@gentoo.org>2012-09-28 16:02:39 +0200
commit97cfa55eea39cef30abe14682c56c1e4e7f6f10d (patch)
tree5ab4d186dda150507a927b2abc4a253739698344 /libavcodec/mpegaudiodec.c
parentd16860a237ae56a21d051df6556c40de9be53faa (diff)
downloadffmpeg-97cfa55eea39cef30abe14682c56c1e4e7f6f10d.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.
Diffstat (limited to 'libavcodec/mpegaudiodec.c')
-rw-r--r--libavcodec/mpegaudiodec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 03094f6260..ead0e1d958 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -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;