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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc

Issue 1677003002: Fix null-pointer dereference in RTPSenderVideo. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 months 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 | « no previous file | 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 223 }
224 224
225 int32_t RTPSenderVideo::SendVideo(const RtpVideoCodecTypes videoType, 225 int32_t RTPSenderVideo::SendVideo(const RtpVideoCodecTypes videoType,
226 const FrameType frameType, 226 const FrameType frameType,
227 const int8_t payloadType, 227 const int8_t payloadType,
228 const uint32_t captureTimeStamp, 228 const uint32_t captureTimeStamp,
229 int64_t capture_time_ms, 229 int64_t capture_time_ms,
230 const uint8_t* payloadData, 230 const uint8_t* payloadData,
231 const size_t payloadSize, 231 const size_t payloadSize,
232 const RTPFragmentationHeader* fragmentation, 232 const RTPFragmentationHeader* fragmentation,
233 const RTPVideoHeader* rtpHdr) { 233 const RTPVideoHeader* rtpHdr) {
stefan-webrtc 2016/02/08 13:58:06 Feel free to rename this to something better.
234 if (payloadSize == 0) { 234 if (payloadSize == 0) {
235 return -1; 235 return -1;
236 } 236 }
237 237
238 rtc::scoped_ptr<RtpPacketizer> packetizer( 238 rtc::scoped_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create(
239 RtpPacketizer::Create(videoType, _rtpSender.MaxDataPayloadLength(), 239 videoType, _rtpSender.MaxDataPayloadLength(),
240 &(rtpHdr->codecHeader), frameType)); 240 rtpHdr ? &(rtpHdr->codecHeader) : nullptr, frameType));
241 241
242 StorageType storage; 242 StorageType storage;
243 bool fec_enabled; 243 bool fec_enabled;
244 { 244 {
245 CriticalSectionScoped cs(crit_.get()); 245 CriticalSectionScoped cs(crit_.get());
246 FecProtectionParams* fec_params = 246 FecProtectionParams* fec_params =
247 frameType == kVideoFrameKey ? &key_fec_params_ : &delta_fec_params_; 247 frameType == kVideoFrameKey ? &key_fec_params_ : &delta_fec_params_;
248 producer_fec_.SetFecParameters(fec_params, 0); 248 producer_fec_.SetFecParameters(fec_params, 0);
249 storage = packetizer->GetStorageType(_retransmissionSettings); 249 storage = packetizer->GetStorageType(_retransmissionSettings);
250 fec_enabled = fec_enabled_; 250 fec_enabled = fec_enabled_;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 CriticalSectionScoped cs(crit_.get()); 350 CriticalSectionScoped cs(crit_.get());
351 return _retransmissionSettings; 351 return _retransmissionSettings;
352 } 352 }
353 353
354 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { 354 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) {
355 CriticalSectionScoped cs(crit_.get()); 355 CriticalSectionScoped cs(crit_.get());
356 _retransmissionSettings = settings; 356 _retransmissionSettings = settings;
357 } 357 }
358 358
359 } // namespace webrtc 359 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698