Fix crash with CVO turned on for VP9 codec

CopyCodecSpecific nulls out the rtpheader pointer hence causing the crash downstream.

More details about the codec type enums:
There are 2 enums defined. webrtc::VideoCodecType webrtc::RtpCodecTypes and they don't match. Inside CopyCodecSpecific in, it was converted from the first to the 2nd type. At that point, it'll be kRtpVideoNone (as the effect of memset to 0). kRtpVideoNone is a bad value as it could cause assert. Later, it'll be reset to kRtpVideoGeneric in RTPSender::SendOutgoingData so it's not a concern.


Review URL:

Cr-Commit-Position: refs/heads/master@{#8951}
diff --git a/webrtc/modules/video_coding/main/source/ b/webrtc/modules/video_coding/main/source/
index 0cc2ec4..17ee4d6 100644
--- a/webrtc/modules/video_coding/main/source/
+++ b/webrtc/modules/video_coding/main/source/
@@ -8,6 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
+#include "webrtc/base/checks.h"
 #include "webrtc/engine_configurations.h"
 #include "webrtc/modules/video_coding/main/source/encoded_frame.h"
 #include "webrtc/modules/video_coding/main/source/generic_encoder.h"
@@ -20,10 +21,7 @@
 // Map information from info into rtp. If no relevant information is found
 // in info, rtp is set to NULL.
 void CopyCodecSpecific(const CodecSpecificInfo* info, RTPVideoHeader** rtp) {
-  if (!info) {
-    *rtp = NULL;
-    return;
-  }
+  DCHECK(info);
   switch (info->codecType) {
     case kVideoCodecVP8: {
       (*rtp)->codec = kRtpVideoVp8;
@@ -46,8 +44,6 @@
       (*rtp)->simulcastIdx = info->codecSpecific.generic.simulcast_idx;
-      // No codec specific info. Change RTP header pointer to NULL.
-      *rtp = NULL;