[FFmpeg-cvslog] r19142 - trunk/libavformat/rtp_mpv.c

lu_zero subversion
Wed Jun 10 16:56:50 CEST 2009


Author: lu_zero
Date: Wed Jun 10 16:56:50 2009
New Revision: 19142

Log:
Make sure buffer end remains constant within the loop

otherwise ff_find_start_code could read over the buffer size

Modified:
   trunk/libavformat/rtp_mpv.c

Modified: trunk/libavformat/rtp_mpv.c
==============================================================================
--- trunk/libavformat/rtp_mpv.c	Tue Jun  9 23:16:40 2009	(r19141)
+++ trunk/libavformat/rtp_mpv.c	Wed Jun 10 16:56:50 2009	(r19142)
@@ -31,6 +31,7 @@ void ff_rtp_send_mpegvideo(AVFormatConte
     RTPMuxContext *s = s1->priv_data;
     int len, h, max_packet_size;
     uint8_t *q;
+    const uint8_t *end = buf1 + size;
     int begin_of_slice, end_of_slice, frame_type, temporal_reference;
 
     max_packet_size = s->max_payload_size;
@@ -55,7 +56,7 @@ void ff_rtp_send_mpegvideo(AVFormatConte
             r1 = buf1;
             while (1) {
                 start_code = -1;
-                r = ff_find_start_code(r1, buf1 + size, &start_code);
+                r = ff_find_start_code(r1, end, &start_code);
                 if((start_code & 0xFFFFFF00) == 0x100) {
                     /* New start code found */
                     if (start_code == 0x100) {



More information about the ffmpeg-cvslog mailing list