From 6d8ed3de00319309e15b58319d2fe6cea9449822 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Wed, 8 Jan 2025 14:04:36 -0800 Subject: [PATCH 1/2] Improve error reporting for TGAs with invalid palettes --- DirectXTex/DirectXTexTGA.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/DirectXTex/DirectXTexTGA.cpp b/DirectXTex/DirectXTexTGA.cpp index 2390ee00..8f84aa6e 100644 --- a/DirectXTex/DirectXTexTGA.cpp +++ b/DirectXTex/DirectXTexTGA.cpp @@ -1679,7 +1679,7 @@ HRESULT DirectX::LoadFromTGAMemory( const size_t remaining = size - offset - paletteOffset; if (remaining == 0) - return E_FAIL; + return HRESULT_E_HANDLE_EOF; const void* pPixels = static_cast(pSource) + offset + paletteOffset; @@ -2127,6 +2127,12 @@ HRESULT DirectX::LoadFromTGAFile( image.Release(); return hr; } + + if ((remaining - paletteOffset) == 0) + { + image.Release(); + return HRESULT_E_HANDLE_EOF; + } } if (convFlags & CONV_FLAGS_RLE) From e7b570ae538e64182a6d36af8c0c44b3adbcc405 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Wed, 8 Jan 2025 14:13:02 -0800 Subject: [PATCH 2/2] GHA Linux runner updated --- .github/workflows/wsl.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wsl.yml b/.github/workflows/wsl.yml index b58efb02..c6bcbe86 100644 --- a/.github/workflows/wsl.yml +++ b/.github/workflows/wsl.yml @@ -30,7 +30,7 @@ jobs: matrix: build_type: [x64-Debug-Linux, x64-Release-Linux] - gcc: [10, 11, 12] + gcc: [12, 13, 14] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2