Zero initialize heap allocations in LibvpxVp9{Decoder,Encoder}
Bug: chromium:1251010 Change-Id: Iffefdc8bee3752f89b0201f56fd06a2253b53200 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232602 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Emil Lundmark <lndmrk@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35049}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
50decc6bd0
commit
7b35b44b52
@ -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));
|
||||
|
||||
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user