Skip to content
Snippets Groups Projects
Commit afbc4d2d authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

Prevent overflow on random input.

Originally committed as revision 24795 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 67197656
No related branches found
No related tags found
No related merge requests found
...@@ -230,7 +230,8 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf, ...@@ -230,7 +230,8 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf,
int prev_len = out_len; int prev_len = out_len;
out_len += cur_len; out_len += cur_len;
asf->buf = av_realloc(asf->buf, out_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); url_fskip(pb, cur_len);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment