Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6e308ae07c58e7517c33cce7078d3bd8ed6a258e
https://github.com/WebKit/WebKit/commit/6e308ae07c58e7517c33cce7078d3bd8ed6a258e
Author: Chris Dumez <[email protected]>
Date: 2026-07-28 (Tue, 28 Jul 2026)
Changed paths:
M Tools/WebKitTestRunner/cocoa/TestInvocationCocoa.mm
Log Message:
-----------
WebKitTestRunner: Fix corrupted pixel hash on big-endian byte-order contexts
https://bugs.webkit.org/show_bug.cgi?id=320353
Reviewed by Mike Wyrzykowski.
computeSHA1HashStringForContext()'s big-endian branch declared its scratch
buffer as Vector<uint8_t> buffer(4 * pixelsWide) but then assigned a 32-bit
value (OSReadLittleInt32) into buffer[column], truncating each pixel to its
low byte and leaving 3/4 of the buffer uninitialized. It then hashed the
entire 4 * pixelsWide-byte span, so the resulting SHA-1 was derived partly
from uninitialized memory and varied run-to-run, making the actual-vs-expected
hash comparison meaningless on any kCGBitmapByteOrder32Big context.
Store the byte-swapped pixels in a Vector<uint32_t> of pixelsWide elements and
hash asBytes(buffer.span()), so every element is written and exactly the bytes
we populated are hashed. This matches the little-endian branch and the
DumpRenderTree implementation in PixelDumpSupportCG.cpp, producing a
deterministic, endianness-independent hash.
* Tools/WebKitTestRunner/cocoa/TestInvocationCocoa.mm:
(WTR::computeSHA1HashStringForContext):
Canonical link: https://commits.webkit.org/318129@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications