Skip to content

tsmux: Fix copying of buffer region

Kyrylo Polezhaiev requested to merge (removed):master into master

In case I try to put more than ten H.264 streams inside TS using mpegtsmux, I have a crash when writing PMT, caused by attempt to write something into GstBuffer pointed by NULL pointer.

This NULL pointer is returned by gst_buffer_copy_region call and saved to packet_buffer local variable in function named tsmux_section_write_packet. That's because wrong size parameter is passed to gst_buffer_copy_region.

Probably we should reset extra_alloc_bytes variable to zero on subsequent iteration (now if we set extra_alloc_bytes to 4, it will still be equal to 4 next time we call gst_buffer_copy_region).

Edited by Kyrylo Polezhaiev

Merge request reports

Loading