From cb22359d027bc44cf84fa53a3ffd81c098816cc8 Mon Sep 17 00:00:00 2001 From: James Zern Date: Mon, 21 Nov 2016 18:20:33 -0800 Subject: [PATCH] vp9,read_inter_block_mode_info: quiet msan warning best_sub8x8[1] won't be used meaningfully when is_compound is false, but may trigger an msan warning as the value is copied around and later clamped. BUG=667044 Change-Id: Icc24c3b72cdb550bebea44d4aaa4ff8bf3fbab56 --- test/invalid_file_test.cc | 1 + test/test-data.mk | 2 ++ test/test-data.sha1 | 2 ++ vp9/decoder/vp9_decodemv.c | 4 ++++ 4 files changed, 9 insertions(+) diff --git a/test/invalid_file_test.cc b/test/invalid_file_test.cc index 2921e5ddf..eae81faa1 100644 --- a/test/invalid_file_test.cc +++ b/test/invalid_file_test.cc @@ -144,6 +144,7 @@ const DecodeParam kVP9InvalidFileTests[] = { { 1, "invalid-vp90-2-03-size-202x210.webm.ivf.s113306_r01-05_b6-.ivf" }, { 1, "invalid-vp90-2-10-show-existing-frame.webm.ivf.s180315_r01-05_b6-.ivf" }, + { 1, "invalid-crbug-667044.webm" }, }; VP9_INSTANTIATE_TEST_CASE(InvalidFileTest, diff --git a/test/test-data.mk b/test/test-data.mk index ebf0cd8c2..c1116f534 100644 --- a/test/test-data.mk +++ b/test/test-data.mk @@ -777,6 +777,8 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-07-frame_parallel-2.web LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-vp90-2-07-frame_parallel-3.webm LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-crbug-629481.webm LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-crbug-629481.webm.res +LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-crbug-667044.webm +LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += invalid-crbug-667044.webm.res ifeq ($(CONFIG_DECODE_PERF_TESTS),yes) # Encode / Decode test diff --git a/test/test-data.sha1 b/test/test-data.sha1 index 7388ddb1a..8b51f064b 100644 --- a/test/test-data.sha1 +++ b/test/test-data.sha1 @@ -845,3 +845,5 @@ a000d568431d07379dd5a8ec066061c07e560b47 *invalid-vp90-2-00-quantizer-63.ivf.kf_ 7602e00378161ca36ae93cc6ee12dd30b5ba1e1d *vp90-2-22-svc_1280x720_3.ivf 02e53e3eefbf25ec0929047fe50876acdeb040bd *vp90-2-22-svc_1280x720_3.ivf.md5 6fa3d3ac306a3d9ce1d610b78441dc00d2c2d4b9 *tos_vp8.webm +e402cbbf9e550ae017a1e9f1f73931c1d18474e8 *invalid-crbug-667044.webm +d3964f9dad9f60363c81b688324d95b4ec7c8038 *invalid-crbug-667044.webm.res diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c index 4372ba037..1a4152436 100644 --- a/vp9/decoder/vp9_decodemv.c +++ b/vp9/decoder/vp9_decodemv.c @@ -770,6 +770,10 @@ static void read_inter_block_mode_info(VP9Decoder *const pbi, int idx, idy; PREDICTION_MODE b_mode; int_mv best_sub8x8[2]; + const uint32_t invalid_mv = 0x80008000; + // Initialize the 2nd element as even though it won't be used meaningfully + // if is_compound is false, copying/clamping it may trigger a MSan warning. + best_sub8x8[1].as_int = invalid_mv; for (idy = 0; idy < 2; idy += num_4x4_h) { for (idx = 0; idx < 2; idx += num_4x4_w) { const int j = idy * 2 + idx;