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.
---
 libavformat/rtmpproto.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index c850a11..da4b8ae 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;
 }
-- 
1.7.9.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to