[FFmpeg-soc] [soc]: r4300 - wmapro/wma3dec.c

faust3 subversion at mplayerhq.hu
Sat May 23 13:25:45 CEST 2009


Author: faust3
Date: Sat May 23 13:25:45 2009
New Revision: 4300

Log:
fixed the input buffer length check in save_bits

Modified:
   wmapro/wma3dec.c

Modified: wmapro/wma3dec.c
==============================================================================
--- wmapro/wma3dec.c	Sat May 23 12:54:21 2009	(r4299)
+++ wmapro/wma3dec.c	Sat May 23 13:25:45 2009	(r4300)
@@ -1492,8 +1492,10 @@ static void wma_save_bits(WMA3DecodeCont
     int bit_offset;
     int pos;
 
-    if(!append)
-        s->num_saved_bits = 0;
+    if(!append){
+        s->frame_offset = get_bits_count(gb) & 7;
+        s->num_saved_bits = s->frame_offset;
+    }
 
     buflen = (s->num_saved_bits + len + 8) >> 3;
 
@@ -1504,8 +1506,7 @@ static void wma_save_bits(WMA3DecodeCont
     }
 
     if(!append){
-        s->frame_offset = get_bits_count(gb) & 7;
-        s->num_saved_bits = s->frame_offset + len;
+        s->num_saved_bits += len;
         memcpy(s->frame_data, gb->buffer + (get_bits_count(gb) >> 3), (s->num_saved_bits  + 8)>> 3);
         skip_bits_long(gb, len);
     }else{


More information about the FFmpeg-soc mailing list