From 8bc773430f23544a39ca765776801385d4ae16c0 Mon Sep 17 00:00:00 2001 From: jackychen Date: Thu, 28 Jul 2016 13:07:43 -0700 Subject: [PATCH] Memset svc_params in vp9 wrapper to avoid undefined behavior. Due to a recent interface change for svc_params in vp9 svc, which allows speed setting per layer, svc_params should be inited to 0 for safety. Review-Url: https://codereview.webrtc.org/2179753003 Cr-Commit-Position: refs/heads/master@{#13561} --- webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc index 52ea1d63cb..884196ad7e 100644 --- a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc +++ b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc @@ -81,6 +81,7 @@ VP9EncoderImpl::VP9EncoderImpl() // Use two spatial when screensharing with flexible mode. spatial_layer_(new ScreenshareLayersVP9(2)) { memset(&codec_, 0, sizeof(codec_)); + memset(&svc_internal_.svc_params, 0, sizeof(vpx_svc_extra_cfg_t)); uint32_t seed = rtc::Time32(); srand(seed); }