From: Martin Storsjo Date: Thu, 5 Dec 2013 09:00:43 +0000 (+0200) Subject: Correct the count of bytes written to the initial FLV buffer X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c89b57271fa4e8548930574c462f3fb98be9276f;p=rtmpdump 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. --- 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) {