From 27566fec3083d0296b26e5a5c736b0cff72aaf75 Mon Sep 17 00:00:00 2001 From: Brad Werth Date: Tue, 2 Sep 2025 20:32:16 +0000 Subject: [PATCH] Bug 1983838: Provide a default convertType implementation. r=ahale a=RyanVM This ensures there are sane values in the dst array. Differential Revision: https://phabricator.services.mozilla.com/D262997 --- dom/canvas/WebGLTexelConversions.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dom/canvas/WebGLTexelConversions.h b/dom/canvas/WebGLTexelConversions.h index 635f3b9f728e..8b67882746ce 100644 --- a/dom/canvas/WebGLTexelConversions.h +++ b/dom/canvas/WebGLTexelConversions.h @@ -1345,6 +1345,11 @@ template MOZ_ALWAYS_INLINE void convertType(const SrcType* __restrict src, DstType* __restrict dst) { MOZ_ASSERT(false, "Unimplemented texture format conversion"); + // Default construct dst values, ensuring they are *some* value. + dst[0] = DstType(); + dst[1] = DstType(); + dst[2] = DstType(); + dst[3] = DstType(); } template <>