summaryrefslogtreecommitdiff
path: root/libavformat/rtmpproto.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-10-03 13:44:38 +0200
committerMartin Storsjö <martin@martin.st>2013-10-04 09:25:08 +0300
commit8921e32f730c191543b84e61338bc9d549aa05a3 (patch)
tree01850f017a5251854e88b8fdc49d800ba5504194 /libavformat/rtmpproto.c
parent24fee95321c1463360ba7042d026dae021854360 (diff)
rtmpproto: Readjust the end of the flv buffer if handle_metadata exited early
If the embedded flv packets were incomplete and we aborted the copying loop early, make sure the flv buffer is trimmed to only contain full packets. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtmpproto.c')
-rw-r--r--libavformat/rtmpproto.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index bc6cd3f56b..e7e37a3656 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -2229,6 +2229,11 @@ static int handle_metadata(RTMPContext *rt, RTMPPacket *pkt)
next += size + 3 + 4;
p += size + 3 + 4;
}
+ if (p != rt->flv_data + rt->flv_size) {
+ av_log(NULL, AV_LOG_WARNING, "Incomplete flv packets in "
+ "RTMP_PT_METADATA packet\n");
+ rt->flv_size = p - rt->flv_data;
+ }
return 0;
}