Glimesh / janus-ftl-plugin

A plugin for the Janus WebRTC gateway to enable relaying of audio/video streams utilizing Mixer's FTL (Faster-Than-Light) protocol.
https://hayden.fyi/posts/2020-08-03-Faster-Than-Light-protocol-engineering-notes.html
GNU Affero General Public License v3.0
44 stars 11 forks source link

🐛 Fix memory corruption by growing keyframe packet vector #128

Closed danstiner closed 3 years ago

danstiner commented 3 years ago

std::transform simply uses ++ to increment where it's inserting, I think the issue was the vector iterator does not grow the vector as packets were being inserted, resulting in corrupted memory.

https://en.cppreference.com/w/cpp/algorithm/transform

Verified I now see thumbnails locally which is neat.

Will also follow up on why no errors were getting logged for this, the reporting thread should have been choking.

danstiner commented 3 years ago

Followed up, after the get function returns and the Keyframe struct is copied, the packet vector is size zero and we just skip streams with no packets, which is pretty reasonable. Adding a functional test of receiving a keyframe seems like the right approach instead.

danstiner commented 3 years ago

Regression from #122