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:
parent
758dff0e97
commit
94623c0cee
1 changed files with 4 additions and 1 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue