We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b4cf59 commit 6d8ed3dCopy full SHA for 6d8ed3d
DirectXTex/DirectXTexTGA.cpp
@@ -1679,7 +1679,7 @@ HRESULT DirectX::LoadFromTGAMemory(
1679
1680
const size_t remaining = size - offset - paletteOffset;
1681
if (remaining == 0)
1682
- return E_FAIL;
+ return HRESULT_E_HANDLE_EOF;
1683
1684
const void* pPixels = static_cast<const uint8_t*>(pSource) + offset + paletteOffset;
1685
@@ -2127,6 +2127,12 @@ HRESULT DirectX::LoadFromTGAFile(
2127
image.Release();
2128
return hr;
2129
}
2130
+
2131
+ if ((remaining - paletteOffset) == 0)
2132
+ {
2133
+ image.Release();
2134
2135
+ }
2136
2137
2138
if (convFlags & CONV_FLAGS_RLE)
0 commit comments