Mercurial > libavformat.hg
diff rtpdec_asf.c @ 6377:7eafa931f4e4 libavformat
Prevent overflow on random input.
author | rbultje |
---|---|
date | Fri, 13 Aug 2010 20:06:18 +0000 |
parents | 491eea5c52d6 |
children |
line wrap: on
line diff
--- 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); } }