1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-14 12:21:55 +00:00

fix bug of shared ptr, must copy the payload for it free it.

This commit is contained in:
winlin 2013-11-26 18:11:45 +08:00
parent 758dff0e97
commit 94623c0cee

View file

@ -1373,7 +1373,10 @@ int SrsSharedPtrMessage::initialize(ISrsMessage* msg, char* payload, int size)
header.payload_length = size;
ptr = new SrsSharedPtr();
ptr->payload = payload;
// should copy the payload once
ptr->payload = new char[size];
memcpy(ptr->payload, payload, size);
ptr->size = size;
if (msg->header.is_video()) {