From b48535e556143111474ae5a64c33a13c24e61a7f Mon Sep 17 00:00:00 2001 From: Sahana Bogar Date: Wed, 1 Jul 2026 14:49:59 +0530 Subject: [PATCH] zero reserved2 field before writing dds header --- Docs/ChangeLog-5x.md | 3 +++ Source/astcenccli_image_load_store.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/Docs/ChangeLog-5x.md b/Docs/ChangeLog-5x.md index 81ecb96e..401d0a9b 100644 --- a/Docs/ChangeLog-5x.md +++ b/Docs/ChangeLog-5x.md @@ -14,6 +14,9 @@ clocked at 4.2 GHz, running `astcenc` using AVX2 and 6 threads. The 5.6.0 release is a minor maintenance release. * **Command line tool updates:** + * **Bug fix:** Zero the trailing reserved field of the DDS header before + writing it, so uncompressed `.dds` output no longer contains uninitialized + stack bytes. * **Bug fix:** Fixed incorrect plane stride when writing an uncompressed 3D LDR image to a DDS container. * **Bug fix:** Fixed potential integer overflow when storing very large diff --git a/Source/astcenccli_image_load_store.cpp b/Source/astcenccli_image_load_store.cpp index 4b677d8c..1741d730 100644 --- a/Source/astcenccli_image_load_store.cpp +++ b/Source/astcenccli_image_load_store.cpp @@ -2249,6 +2249,7 @@ static bool store_dds_uncompressed_image( hdr.caps2 = (dim_z > 1) ? 0x200000 : 0; hdr.caps3 = 0; hdr.caps4 = 0; + hdr.reserved2 = 0; // Pixel-format data if (bitness == 8)