Commit 3a92799489 for aom
commit 3a927994899b86c18d0677ed79ca254da6e5ee63
Author: Frank Galligan <fgalligan@google.com>
Date: Fri Nov 6 08:11:24 2026 -0800
test: 2-byte align kBuffer for highbd tests
Commit 0ba703305c added 2-byte plane and stride alignment validation
for high bit-depth images in validate_img(), and updated Encode1x1()
in test/encode_small_width_height_test.cc, but left kBuffer as an
unaligned unsigned char array.
Depending on the total .rodata size of preceding object files, the
linker can place kBuffer at an odd address (observed on ARM Clang
TSan builds), causing aom_img_wrap() with AOM_IMG_FMT_I42016 to pass
odd plane pointers to aom_codec_encode() and fail all four
HighbdEncodeSmallWidthHeight multi-threaded tests with
AOM_CODEC_INVALID_PARAM.
Add alignas(2) to kBuffer so the wrapped AOM_IMG_FMT_I42016 planes
are always 2-byte aligned.
Bug: 578678096
TAG=agy
CONV=b929a630-a6cd-45a0-979c-1767c30178ee
Change-Id: I1fab3af238501ed1f7f7e1cecc57f6da9ec58bbb
diff --git a/test/encode_small_width_height_test.cc b/test/encode_small_width_height_test.cc
index 3f15057770..66e97967c4 100644
--- a/test/encode_small_width_height_test.cc
+++ b/test/encode_small_width_height_test.cc
@@ -25,8 +25,11 @@
namespace {
-// Dummy buffer of zero samples.
-constexpr unsigned char kBuffer[2 * (256 * 512 + 2 * 128 * 256)] = { 0 };
+// Dummy buffer of zero samples. Must be 2-byte aligned because high bit-depth
+// tests wrap it as AOM_IMG_FMT_I42016.
+alignas(2) constexpr unsigned char kBuffer[2 * (256 * 512 + 2 * 128 * 256)] = {
+ 0
+};
#if CONFIG_REALTIME_ONLY
const int kUsage = 1;
#else