正在显示
1 个修改的文件
包含
4 行增加
和
1 行删除
@@ -1373,7 +1373,10 @@ int SrsSharedPtrMessage::initialize(ISrsMessage* msg, char* payload, int size) | @@ -1373,7 +1373,10 @@ int SrsSharedPtrMessage::initialize(ISrsMessage* msg, char* payload, int size) | ||
1373 | header.payload_length = size; | 1373 | header.payload_length = size; |
1374 | 1374 | ||
1375 | ptr = new SrsSharedPtr(); | 1375 | ptr = new SrsSharedPtr(); |
1376 | - ptr->payload = payload; | 1376 | + |
1377 | + // should copy the payload once | ||
1378 | + ptr->payload = new char[size]; | ||
1379 | + memcpy(ptr->payload, payload, size); | ||
1377 | ptr->size = size; | 1380 | ptr->size = size; |
1378 | 1381 | ||
1379 | if (msg->header.is_video()) { | 1382 | if (msg->header.is_video()) { |
-
请 注册 或 登录 后发表评论