[FFmpeg-cvslog] r24795 - trunk/libavformat/rtpdec_asf.c

rbultje subversion
Fri Aug 13 22:06:18 CEST 2010


Author: rbultje
Date: Fri Aug 13 22:06:18 2010
New Revision: 24795

Log:
Prevent overflow on random input.

Modified:
   trunk/libavformat/rtpdec_asf.c

Modified: trunk/libavformat/rtpdec_asf.c
==============================================================================
--- trunk/libavformat/rtpdec_asf.c	Fri Aug 13 19:30:01 2010	(r24794)
+++ trunk/libavformat/rtpdec_asf.c	Fri Aug 13 22:06:18 2010	(r24795)
@@ -230,7 +230,8 @@ static int asfrtp_parse_packet(AVFormatC
                 int prev_len = out_len;
                 out_len += cur_len;
                 asf->buf = av_realloc(asf->buf, out_len);
-                memcpy(asf->buf + prev_len, buf + off, cur_len);
+                memcpy(asf->buf + prev_len, buf + off,
+                       FFMIN(cur_len, len - off));
                 url_fskip(pb, cur_len);
             }
         }



More information about the ffmpeg-cvslog mailing list