summaryrefslogtreecommitdiff
path: root/libavcodec/mpegaudiodec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-02-04 15:49:55 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-02-04 15:49:55 +0000
commit2caa92d9358c53fccc424c5892df817c2c13b1e4 (patch)
tree8e97a9d6b8e96e71e98de8ecdab1db048403409a /libavcodec/mpegaudiodec.c
parent7d8379f2b78e255b6f8c8bee1a6d41cd8340b0a2 (diff)
fixes by Gildas Bazin <gbazin at altern dot org>
Originally committed as revision 2745 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegaudiodec.c')
-rw-r--r--libavcodec/mpegaudiodec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 09e9b8cdbc..58caf65109 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -1231,6 +1231,7 @@ static int decode_header(MPADecodeContext *s, uint32_t header)
int mpa_decode_header(AVCodecContext *avctx, uint32_t head)
{
MPADecodeContext s1, *s = &s1;
+ memset( s, 0, sizeof(MPADecodeContext) );
if (check_header(head) != 0)
return -1;
@@ -1373,6 +1374,10 @@ static int mp_decode_layer2(MPADecodeContext *s)
bound = sblimit;
dprintf("bound=%d sblimit=%d\n", bound, sblimit);
+
+ /* sanity check */
+ if( bound > sblimit ) bound = sblimit;
+
/* parse bit allocation */
j = 0;
for(i=0;i<bound;i++) {