mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-09 03:30:13 +02:00
Improve error reporting for TGAs with invalid palettes (#570)
This commit is contained in:
parent
9b4cf594ef
commit
8f79186b15
2
.github/workflows/wsl.yml
vendored
2
.github/workflows/wsl.yml
vendored
@ -30,7 +30,7 @@ jobs:
|
|||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
build_type: [x64-Debug-Linux, x64-Release-Linux]
|
build_type: [x64-Debug-Linux, x64-Release-Linux]
|
||||||
gcc: [10, 11, 12]
|
gcc: [12, 13, 14]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
|
@ -1679,7 +1679,7 @@ HRESULT DirectX::LoadFromTGAMemory(
|
|||||||
|
|
||||||
const size_t remaining = size - offset - paletteOffset;
|
const size_t remaining = size - offset - paletteOffset;
|
||||||
if (remaining == 0)
|
if (remaining == 0)
|
||||||
return E_FAIL;
|
return HRESULT_E_HANDLE_EOF;
|
||||||
|
|
||||||
const void* pPixels = static_cast<const uint8_t*>(pSource) + offset + paletteOffset;
|
const void* pPixels = static_cast<const uint8_t*>(pSource) + offset + paletteOffset;
|
||||||
|
|
||||||
@ -2127,6 +2127,12 @@ HRESULT DirectX::LoadFromTGAFile(
|
|||||||
image.Release();
|
image.Release();
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((remaining - paletteOffset) == 0)
|
||||||
|
{
|
||||||
|
image.Release();
|
||||||
|
return HRESULT_E_HANDLE_EOF;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (convFlags & CONV_FLAGS_RLE)
|
if (convFlags & CONV_FLAGS_RLE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user