Skip to content

Commit 6b059bc

Browse files
committed
Minor code review change for PPM/PFM code
1 parent 4602b8e commit 6b059bc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Texconv/PortablePixMap.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ namespace
8686

8787
HRESULT ReadData(_In_z_ const wchar_t* szFile, std::unique_ptr<uint8_t[]>& blob, size_t& blobSize)
8888
{
89+
if (!szFile)
90+
return E_INVALIDARG;
91+
8992
blob.reset();
9093

9194
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
@@ -361,6 +364,9 @@ HRESULT __cdecl SaveToPortablePixMap(
361364
_In_ const Image& image,
362365
_In_z_ const wchar_t* szFile) noexcept
363366
{
367+
if (!szFile)
368+
return E_INVALIDARG;
369+
364370
switch (image.format)
365371
{
366372
case DXGI_FORMAT_R8G8B8A8_UNORM:
@@ -688,6 +694,9 @@ HRESULT __cdecl SaveToPortablePixMapHDR(
688694
_In_ const Image& image,
689695
_In_z_ const wchar_t* szFile) noexcept
690696
{
697+
if (!szFile)
698+
return E_INVALIDARG;
699+
691700
switch (image.format)
692701
{
693702
case DXGI_FORMAT_R32G32B32A32_FLOAT:

0 commit comments

Comments
 (0)