Skip to content

Commit

Permalink
fixed memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
PHZ76 committed Mar 6, 2021
1 parent 385a905 commit ce297b6
Show file tree
Hide file tree
Showing 51 changed files with 23,413 additions and 23,393 deletions.
4 changes: 2 additions & 2 deletions example/rtmp_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,13 @@ int TestRtmpPublisher(xop::EventLoop *event_loop)
xop::Nal sps = xop::H264Parser::findNal(frame_buf, frameSize);
if (sps.first != nullptr && sps.second != nullptr && *sps.first == 0x67) {
media_info.sps_size = (uint32_t)(sps.second - sps.first + 1);
media_info.sps.reset(new uint8_t[media_info.sps_size]);
media_info.sps.reset(new uint8_t[media_info.sps_size], std::default_delete<uint8_t[]>());
memcpy(media_info.sps.get(), sps.first, media_info.sps_size);

xop::Nal pps = xop::H264Parser::findNal(sps.second, frameSize - (int)(sps.second - frame_buf));
if (pps.first != nullptr && pps.second != nullptr && *pps.first == 0x68) {
media_info.pps_size = (uint32_t)(pps.second - pps.first + 1);
media_info.pps.reset(new uint8_t[media_info.pps_size]);
media_info.pps.reset(new uint8_t[media_info.pps_size], std::default_delete<uint8_t[]>());
memcpy(media_info.pps.get(), pps.first, media_info.pps_size);

has_sps_pps = true;
Expand Down
32 changes: 16 additions & 16 deletions src/3rdpart/mongoose/LICENSE
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Copyright (c) 2004-2013 Sergey Lyubka <valenok@gmail.com>
Copyright (c) 2013-2018 Cesanta Software Limited
All rights reserved

This software is dual-licensed: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation. For the terms of this
license, see <http://www.gnu.org/licenses/>.

You are free to use this software under the terms of the GNU General
Public License, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

Alternatively, you can license this software under a commercial
license, as set out in <https://www.cesanta.com/license>.
Copyright (c) 2004-2013 Sergey Lyubka <valenok@gmail.com>
Copyright (c) 2013-2018 Cesanta Software Limited
All rights reserved
This software is dual-licensed: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation. For the terms of this
license, see <http://www.gnu.org/licenses/>.
You are free to use this software under the terms of the GNU General
Public License, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
Alternatively, you can license this software under a commercial
license, as set out in <https://www.cesanta.com/license>.
Loading

0 comments on commit ce297b6

Please sign in to comment.