You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-11 14:30:22 +02:00
rtmpproto: Clear the flv allocation size on reallocp failures
This was overlooked in d872fb0f7
since I assumed all the realloc
issues in the rtmp code was fixed already.
Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
@ -2098,8 +2098,10 @@ static int append_flv_data(RTMPContext *rt, RTMPPacket *pkt, int skip)
|
|||||||
|
|
||||||
old_flv_size = update_offset(rt, size);
|
old_flv_size = update_offset(rt, size);
|
||||||
|
|
||||||
if ((ret = av_reallocp(&rt->flv_data, rt->flv_size)) < 0)
|
if ((ret = av_reallocp(&rt->flv_data, rt->flv_size)) < 0) {
|
||||||
|
rt->flv_size = rt->flv_off = 0;
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
bytestream2_init_writer(&pbc, rt->flv_data, rt->flv_size);
|
bytestream2_init_writer(&pbc, rt->flv_data, rt->flv_size);
|
||||||
bytestream2_skip_p(&pbc, old_flv_size);
|
bytestream2_skip_p(&pbc, old_flv_size);
|
||||||
bytestream2_put_byte(&pbc, pkt->type);
|
bytestream2_put_byte(&pbc, pkt->type);
|
||||||
@ -2199,8 +2201,10 @@ static int handle_metadata(RTMPContext *rt, RTMPPacket *pkt)
|
|||||||
|
|
||||||
old_flv_size = update_offset(rt, pkt->size);
|
old_flv_size = update_offset(rt, pkt->size);
|
||||||
|
|
||||||
if ((ret = av_reallocp(&rt->flv_data, rt->flv_size)) < 0)
|
if ((ret = av_reallocp(&rt->flv_data, rt->flv_size)) < 0) {
|
||||||
|
rt->flv_size = rt->flv_off = 0;
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
next = pkt->data;
|
next = pkt->data;
|
||||||
p = rt->flv_data + old_flv_size;
|
p = rt->flv_data + old_flv_size;
|
||||||
|
Reference in New Issue
Block a user