# HG changeset patch # User rbultje # Date 1281729978 0 # Node ID 7eafa931f4e4d229947239c97335c2f77dc461b5 # Parent 91076395b8d3aa4d6551e1d97e8282eb71282376 Prevent overflow on random input. diff -r 91076395b8d3 -r 7eafa931f4e4 rtpdec_asf.c --- a/rtpdec_asf.c Fri Aug 13 17:30:01 2010 +0000 +++ b/rtpdec_asf.c Fri Aug 13 20:06:18 2010 +0000 @@ -230,7 +230,8 @@ 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); } }