You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
rtpdec_asf: fix memleak
Based on a suggestion by Ronald S. Bultje Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -233,10 +233,14 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf,
|
|||||||
|
|
||||||
int cur_len = start_off + len_off - off;
|
int cur_len = start_off + len_off - off;
|
||||||
int prev_len = out_len;
|
int prev_len = out_len;
|
||||||
|
void *newbuf;
|
||||||
out_len += cur_len;
|
out_len += cur_len;
|
||||||
asf->buf = av_realloc(asf->buf, out_len);
|
if(FFMIN(cur_len, len - off)<0)
|
||||||
if(!asf->buf || FFMIN(cur_len, len - off)<0)
|
|
||||||
return -1;
|
return -1;
|
||||||
|
newbuf = av_realloc(asf->buf, out_len);
|
||||||
|
if(!newbuf)
|
||||||
|
return -1;
|
||||||
|
asf->buf= newbuf;
|
||||||
memcpy(asf->buf + prev_len, buf + off,
|
memcpy(asf->buf + prev_len, buf + off,
|
||||||
FFMIN(cur_len, len - off));
|
FFMIN(cur_len, len - off));
|
||||||
avio_skip(pb, cur_len);
|
avio_skip(pb, cur_len);
|
||||||
|
Reference in New Issue
Block a user