diff options
author | Josh Allmann <joshua.allmann@gmail.com> | 2018-01-23 16:47:12 -0800 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2018-01-24 07:16:06 +0200 |
commit | a2a9e4eea0e4fde2ed8d3405b4f33f655b600c2d (patch) | |
tree | 01e43116dc0e56233304cfe83cae05ee0263571d | |
parent | 85e10c0a9321bfe0d2afe0f3983ab6a8df6e3fba (diff) | |
download | ffmpeg-a2a9e4eea0e4fde2ed8d3405b4f33f655b600c2d.tar.gz |
rtmp: Plug leak if sending bytes read report fails.
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavformat/rtmpproto.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 115c335974..48c5ead747 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -2396,8 +2396,10 @@ static int get_packet(URLContext *s, int for_header) rt->bytes_read += ret; if (rt->bytes_read - rt->last_bytes_read > rt->receive_report_size) { av_log(s, AV_LOG_DEBUG, "Sending bytes read report\n"); - if ((ret = gen_bytes_read(s, rt, rpkt.timestamp + 1)) < 0) + if ((ret = gen_bytes_read(s, rt, rpkt.timestamp + 1)) < 0) { + ff_rtmp_packet_destroy(&rpkt); return ret; + } rt->last_bytes_read = rt->bytes_read; } |