Skip to content

Commit

Permalink
Extra check for a null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Nov 6, 2024
1 parent ab623b6 commit 31b6ea5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions DirectXTex/DirectXTexCompressGPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ HRESULT DirectX::CompressEx(
|| IsTypeless(srcImage.format) || IsPlanar(srcImage.format) || IsPalettized(srcImage.format))
return HRESULT_E_NOT_SUPPORTED;

if (!srcImage.pixels)
return E_POINTER;

// Setup GPU compressor
std::unique_ptr<GPUCompressBC> gpubc(new (std::nothrow) GPUCompressBC);
if (!gpubc)
Expand Down

0 comments on commit 31b6ea5

Please sign in to comment.