diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-04 14:13:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-04 14:17:53 +0200 |
commit | 205b6021358efa06c66e835dd4b265cf7cbc4047 (patch) | |
tree | a73f43ad97cf1d44fb75be0f9153cbae0847e535 /libavformat | |
parent | d32eec3359da9019fe8b4994397d16001433ce40 (diff) | |
parent | 72540e514ceaaed8ecb97ed63637b2a2a4447ab8 (diff) | |
download | ffmpeg-205b6021358efa06c66e835dd4b265cf7cbc4047.tar.gz |
Merge commit '72540e514ceaaed8ecb97ed63637b2a2a4447ab8'
* commit '72540e514ceaaed8ecb97ed63637b2a2a4447ab8':
rtmpproto: Clear the flv allocation size on reallocp failures
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/rtmpproto.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 223ec6ca4e..77903e47a8 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -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; |