Commit 205b6021 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '72540e51'

* commit '72540e51':
  rtmpproto: Clear the flv allocation size on reallocp failures
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents d32eec33 72540e51
......@@ -2095,8 +2095,10 @@ static int append_flv_data(RTMPContext *rt, RTMPPacket *pkt, int skip)
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;
}
bytestream2_init_writer(&pbc, rt->flv_data, rt->flv_size);
bytestream2_skip_p(&pbc, old_flv_size);
bytestream2_put_byte(&pbc, pkt->type);
......@@ -2196,8 +2198,10 @@ static int handle_metadata(RTMPContext *rt, RTMPPacket *pkt)
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;
}
next = pkt->data;
p = rt->flv_data + old_flv_size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment