changeset 1780:cc4c1eb18eec libavcodec

fixes by Gildas Bazin <gbazin at altern dot org>
author michael
date Wed, 04 Feb 2004 15:49:55 +0000
parents 9848ca4ad861
children bbb6e7667671
files mpegaudiodec.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mpegaudiodec.c	Tue Feb 03 04:27:17 2004 +0000
+++ b/mpegaudiodec.c	Wed Feb 04 15:49:55 2004 +0000
@@ -1231,6 +1231,7 @@
 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 @@
         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++) {