From c89b57271fa4e8548930574c462f3fb98be9276f Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Thu, 5 Dec 2013 11:00:43 +0200 Subject: [PATCH] Correct the count of bytes written to the initial FLV buffer This matters if the buffer overflows, when the count is used for patching the buffer back together. This happens if there are multiple video packets with zero timestamp at the start of the stream (before any audio packets), enough to fill the buffer. --- librtmp/rtmp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c index 014ff8b..8c7b8d4 100644 --- a/librtmp/rtmp.c +++ b/librtmp/rtmp.c @@ -5009,6 +5009,7 @@ fail: memcpy(mybuf, flvHeader, sizeof(flvHeader)); r->m_read.buf += sizeof(flvHeader); r->m_read.buflen -= sizeof(flvHeader); + cnt += sizeof(flvHeader); while (r->m_read.timestamp == 0) { -- 2.11.4.GIT