mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-23 03:10:04 +08:00
初始化内存 (#1162)
This commit is contained in:
parent
290b3f37a5
commit
2a2597a874
@ -454,6 +454,7 @@ std::shared_ptr<RtcpSdes> RtcpSdes::create(const std::vector<string> &item_text)
|
|||||||
auto real_size = sizeof(RtcpSdes) - sizeof(SdesChunk) + item_total_size;
|
auto real_size = sizeof(RtcpSdes) - sizeof(SdesChunk) + item_total_size;
|
||||||
auto bytes = alignSize(real_size);
|
auto bytes = alignSize(real_size);
|
||||||
auto ptr = (RtcpSdes *) new char[bytes];
|
auto ptr = (RtcpSdes *) new char[bytes];
|
||||||
|
memset(ptr, 0x00, bytes);
|
||||||
auto item_ptr = &ptr->chunks;
|
auto item_ptr = &ptr->chunks;
|
||||||
for (auto &text : item_text) {
|
for (auto &text : item_text) {
|
||||||
item_ptr->txt_len = (0xFF & text.size());
|
item_ptr->txt_len = (0xFF & text.size());
|
||||||
|
Loading…
Reference in New Issue
Block a user