From: Luca Barbato Date: Fri, 28 Sep 2012 12:38:13 +0000 (+0200) Subject: mpegaudiodec: fix short_start calculation X-Git-Tag: v9_beta1~236 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97cfa55eea39cef30abe14682c56c1e4e7f6f10d;p=platform%2Fupstream%2Flibav.git 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. --- diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 03094f6..ead0e1d 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;