[FFmpeg-cvslog] mpegaudiodec: fix short_start calculation

Luca Barbato git at videolan.org
Thu Oct 25 17:26:57 CEST 2012


ffmpeg | branch: release/0.10 | Luca Barbato <lu_zero at gentoo.org> | Fri Sep 28 14:38:13 2012 +0200| [0f3381ad5bff4c21ba8631fcb54e7e26b6a96803] | committer: Reinhard Tartler

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 at tauware.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0f3381ad5bff4c21ba8631fcb54e7e26b6a96803
---

 libavcodec/mpegaudiodec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index d902573..bb1baef 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;



More information about the ffmpeg-cvslog mailing list