[rtmpdump] Bug that creates malformed FLV files for live streams and a suggested fix

Howard Chu hyc at highlandsun.com
Wed Jan 16 13:34:30 CET 2013


Kirill K wrote:
> Hey all,
>
> I have encountered problem of downloading several live video streams with
> latest version (any version starting 2.3 and up to latest version in trunk) -
> the recorded files were no playable. My investigation showed that the problem
> mostly appeared in live video streams that were broadcasted with Flash 11
> client in h264 codec. Debug session (on windows machine :-() showed that the
> problem happens when many first chunks has 0 time stamps so there's a trigger
> for realloc just before buffer overflow. The reallocation doesn't consider the
> first 13 bytes of the header that exists in the buffer and that's how 13 bytes
> get vaporized. It forces next chunk to start in incorrect offset and the
> stream becomes unplayable.
>
> Suggested fix: in file rtmp.c add on line 5001:
> cnt = sizeof(flvHeader);

Please post your fix using git format-patch.



More information about the rtmpdump mailing list