From 4d112c132fed14fa61059b2fe20399a51639c98d Mon Sep 17 00:00:00 2001 From: MediaPipe Team Date: Tue, 2 May 2023 10:35:16 -0700 Subject: [PATCH] Fix msan errors. PiperOrigin-RevId: 528825081 --- .../autoflip/quality/padding_effect_generator_test.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mediapipe/examples/desktop/autoflip/quality/padding_effect_generator_test.cc b/mediapipe/examples/desktop/autoflip/quality/padding_effect_generator_test.cc index 84b229d80..4c9e96b88 100644 --- a/mediapipe/examples/desktop/autoflip/quality/padding_effect_generator_test.cc +++ b/mediapipe/examples/desktop/autoflip/quality/padding_effect_generator_test.cc @@ -190,14 +190,16 @@ TEST(PaddingEffectGeneratorTest, ScaleToMultipleOfTwo) { double target_aspect_ratio = 0.5; int expect_width = 14; int expect_height = input_height; - auto test_frame = absl::make_unique(/*format=*/ImageFormat::SRGB, - input_width, input_height); + ImageFrame test_frame(/*format=*/ImageFormat::SRGB, input_width, + input_height); + cv::Mat mat = formats::MatView(&test_frame); + mat = cv::Scalar(0, 0, 0); - PaddingEffectGenerator generator(test_frame->Width(), test_frame->Height(), + PaddingEffectGenerator generator(test_frame.Width(), test_frame.Height(), target_aspect_ratio, /*scale_to_multiple_of_two=*/true); ImageFrame result_frame; - MP_ASSERT_OK(generator.Process(*test_frame, 0.3, 40, 0.0, &result_frame)); + MP_ASSERT_OK(generator.Process(test_frame, 0.3, 40, 0.0, &result_frame)); EXPECT_EQ(result_frame.Width(), expect_width); EXPECT_EQ(result_frame.Height(), expect_height); }