Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: webrtc/video/rtp_stream_receiver.cc

Issue 2535203002: Fix memory leak in video_coding::PacketBuffer::InsertPacket. (Closed)
Patch Set: Feedback fix. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/video_coding/video_packet_buffer_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 return 0; 267 return 0;
268 case video_coding::H264SpsPpsTracker::kInsert: 268 case video_coding::H264SpsPpsTracker::kInsert:
269 break; 269 break;
270 } 270 }
271 } else { 271 } else {
272 uint8_t* data = new uint8_t[packet.sizeBytes]; 272 uint8_t* data = new uint8_t[packet.sizeBytes];
273 memcpy(data, packet.dataPtr, packet.sizeBytes); 273 memcpy(data, packet.dataPtr, packet.sizeBytes);
274 packet.dataPtr = data; 274 packet.dataPtr = data;
275 } 275 }
276 276
277 packet_buffer_->InsertPacket(packet); 277 packet_buffer_->InsertPacket(&packet);
278 } else { 278 } else {
279 if (video_receiver_->IncomingPacket(payload_data, payload_size, 279 if (video_receiver_->IncomingPacket(payload_data, payload_size,
280 rtp_header_with_ntp) != 0) { 280 rtp_header_with_ntp) != 0) {
281 // Check this... 281 // Check this...
282 return -1; 282 return -1;
283 } 283 }
284 } 284 }
285 return 0; 285 return 0;
286 } 286 }
287 287
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 const std::string& extension, int id) { 636 const std::string& extension, int id) {
637 // One-byte-extension local identifiers are in the range 1-14 inclusive. 637 // One-byte-extension local identifiers are in the range 1-14 inclusive.
638 RTC_DCHECK_GE(id, 1); 638 RTC_DCHECK_GE(id, 1);
639 RTC_DCHECK_LE(id, 14); 639 RTC_DCHECK_LE(id, 14);
640 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension)); 640 RTC_DCHECK(RtpExtension::IsSupportedForVideo(extension));
641 RTC_CHECK(rtp_header_parser_->RegisterRtpHeaderExtension( 641 RTC_CHECK(rtp_header_parser_->RegisterRtpHeaderExtension(
642 StringToRtpExtensionType(extension), id)); 642 StringToRtpExtensionType(extension), id));
643 } 643 }
644 644
645 } // namespace webrtc 645 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/video_packet_buffer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698