[FFmpeg-cvslog] r26367 - trunk/libavcodec/wmaprodec.c

faust3 subversion
Sat Jan 15 17:39:52 CET 2011


Author: faust3
Date: Sat Jan 15 17:39:52 2011
New Revision: 26367

Log:
do not read over the end of the packet
fixes issue 2543

Modified:
   trunk/libavcodec/wmaprodec.c

Modified: trunk/libavcodec/wmaprodec.c
==============================================================================
--- trunk/libavcodec/wmaprodec.c	Sat Jan 15 17:26:42 2011	(r26366)
+++ trunk/libavcodec/wmaprodec.c	Sat Jan 15 17:39:52 2011	(r26367)
@@ -1506,6 +1506,12 @@ static int decode_packet(AVCodecContext 
         s->packet_sequence_number = packet_sequence_number;
 
         if (num_bits_prev_frame > 0) {
+            int remaining_packet_bits = s->buf_bit_size - get_bits_count(gb);
+            if (num_bits_prev_frame >= remaining_packet_bits) {
+                num_bits_prev_frame = remaining_packet_bits;
+                s->packet_done = 1;
+            }
+
             /** append the previous frame data to the remaining data from the
                 previous packet to create a full frame */
             save_bits(s, gb, num_bits_prev_frame, 1);



More information about the ffmpeg-cvslog mailing list