]> granicus.if.org Git - rtmpdump/commitdiff
Correct the count of bytes written to the initial FLV buffer
authorMartin Storsjo <martin@martin.st>
Thu, 5 Dec 2013 09:00:43 +0000 (11:00 +0200)
committerMartin Storsjo <martin@martin.st>
Thu, 5 Dec 2013 09:00:43 +0000 (11:00 +0200)
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

index 014ff8bbf7a96e0f83779122d01337766d2a3d3d..8c7b8d43151edc5e859ea0c9a6383c1019334615 100644 (file)
@@ -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)
            {