encode_api_test: quiet static analysis warning
authorJames Zern <jzern@google.com>
Tue, 19 Jul 2022 23:30:59 +0000 (16:30 -0700)
committerJames Zern <jzern@google.com>
Tue, 19 Jul 2022 23:36:15 +0000 (16:36 -0700)
in ConfigChangeThreadCount(); initialize cfg as the static analyzer can
assume AlwaysTrue() within EXPECT_NO_FATAL_FAILURE may return false
causing InitCodec() not to be called.

test/encode_api_test.cc|321 col 3| warning: 1st function call argument
is an uninitialized value [core.CallAndMessage]
  video.SetSize(cfg.g_w, cfg.g_h);

Bug: b/229626362
Change-Id: I54899ed0a207ca685416bed3a0e9c9644668e163

test/encode_api_test.cc

index 6f61c77..0815914 100644 (file)
@@ -336,7 +336,7 @@ TEST(EncodeAPI, ConfigChangeThreadCount) {
   for (const auto *iface : kCodecIfaces) {
     SCOPED_TRACE(vpx_codec_iface_name(iface));
     for (int i = 0; i < (IsVP9(iface) ? 2 : 1); ++i) {
-      vpx_codec_enc_cfg_t cfg;
+      vpx_codec_enc_cfg_t cfg = {};
       struct Encoder {
         ~Encoder() { EXPECT_EQ(vpx_codec_destroy(&ctx), VPX_CODEC_OK); }
         vpx_codec_ctx_t ctx = {};