diff --git a/modules/video_coding/codecs/vp9/libvpx_vp9_decoder.cc b/modules/video_coding/codecs/vp9/libvpx_vp9_decoder.cc index 9f363ffdc1..40b4d8233c 100644 --- a/modules/video_coding/codecs/vp9/libvpx_vp9_decoder.cc +++ b/modules/video_coding/codecs/vp9/libvpx_vp9_decoder.cc @@ -127,6 +127,7 @@ bool LibvpxVp9Decoder::Configure(const Settings& settings) { if (decoder_ == nullptr) { decoder_ = new vpx_codec_ctx_t; + memset(decoder_, 0, sizeof(*decoder_)); } vpx_codec_dec_cfg_t cfg; memset(&cfg, 0, sizeof(cfg)); diff --git a/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc b/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc index cfb69fdb76..ebe4c1e33d 100644 --- a/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc +++ b/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc @@ -530,9 +530,11 @@ int LibvpxVp9Encoder::InitEncode(const VideoCodec* inst, } if (encoder_ == nullptr) { encoder_ = new vpx_codec_ctx_t; + memset(encoder_, 0, sizeof(*encoder_)); } if (config_ == nullptr) { config_ = new vpx_codec_enc_cfg_t; + memset(config_, 0, sizeof(*config_)); } timestamp_ = 0; if (&codec_ != inst) {