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

Unified Diff: webrtc/video/video_receive_stream.cc

Issue 1507643004: Lint clean video/ and add lint presubmit check. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: ostringstream Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/video_quality_test.cc ('k') | webrtc/video/video_send_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_receive_stream.cc
diff --git a/webrtc/video/video_receive_stream.cc b/webrtc/video/video_receive_stream.cc
index 5bc79d6820d5c8c064cff7649e993c16ad61eed4..9d1664e678058231a8cde21f731929d2e429c15b 100644
--- a/webrtc/video/video_receive_stream.cc
+++ b/webrtc/video/video_receive_stream.cc
@@ -12,6 +12,7 @@
#include <stdlib.h>
+#include <set>
#include <string>
#include "webrtc/base/checks.h"
@@ -111,7 +112,7 @@ VideoCodec CreateDecoderVideoCodec(const VideoReceiveStream::Decoder& decoder) {
memset(&codec, 0, sizeof(codec));
codec.plType = decoder.payload_type;
- strcpy(codec.plName, decoder.payload_name.c_str());
+ strncpy(codec.plName, decoder.payload_name.c_str(), sizeof(codec.plName));
if (decoder.payload_name == "VP8") {
codec.codecType = kVideoCodecVP8;
} else if (decoder.payload_name == "VP9") {
@@ -228,7 +229,7 @@ VideoReceiveStream::VideoReceiveStream(
VideoCodec codec;
memset(&codec, 0, sizeof(codec));
codec.codecType = kVideoCodecULPFEC;
- strcpy(codec.plName, "ulpfec");
+ strncpy(codec.plName, "ulpfec", sizeof(codec.plName));
codec.plType = config_.rtp.fec.ulpfec_payload_type;
RTC_CHECK_EQ(0, vie_channel_->SetReceiveCodec(codec));
}
@@ -236,7 +237,7 @@ VideoReceiveStream::VideoReceiveStream(
VideoCodec codec;
memset(&codec, 0, sizeof(codec));
codec.codecType = kVideoCodecRED;
- strcpy(codec.plName, "red");
+ strncpy(codec.plName, "red", sizeof(codec.plName));
codec.plType = config_.rtp.fec.red_payload_type;
RTC_CHECK_EQ(0, vie_channel_->SetReceiveCodec(codec));
if (config_.rtp.fec.red_rtx_payload_type != -1) {
« no previous file with comments | « webrtc/video/video_quality_test.cc ('k') | webrtc/video/video_send_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698