ultravideo / uvgRTP

An open-source library for RTP/SRTP media delivery
BSD 2-Clause "Simplified" License
318 stars 90 forks source link

Null pointer in rtp.cc #220

Closed Atlas42 closed 2 months ago

Atlas42 commented 4 months ago

I had a segfault here :

https://github.com/ultravideo/uvgRTP/blob/f75942b0e5afab0692707cd6bc3cac9557c15f9e/src/rtp.cc#L323

The (*out)->payload is null, and if I am reading the code well, is only initialized a few lines after.

I believe the proper code should be: uint8_t padding_len = packet[size - 1]; But I am not entirely sure.

jrsnen commented 4 months ago

We haven't tested the padding much. At least, it should not crash if the payload size is 0.

BR, Joni

jrsnen commented 2 months ago

Fixed by 69f869c6b6784f378a59fbeb70babf25174a9136. Thanks.