From 3d519cda7f005b96d5a5442d45ded9a9dfbb23d4 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Wed, 9 Oct 2024 14:35:33 -0700 Subject: [PATCH] WaveFrontReader should check for null parameter --- Utilities/WaveFrontReader.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Utilities/WaveFrontReader.h b/Utilities/WaveFrontReader.h index c46412b..99fb5ec 100644 --- a/Utilities/WaveFrontReader.h +++ b/Utilities/WaveFrontReader.h @@ -78,6 +78,9 @@ namespace DX { Clear(); + if (!szFileName) + return E_INVALIDARG; + constexpr size_t MAX_POLY = 64; using namespace DirectX; @@ -421,6 +424,9 @@ namespace DX HRESULT LoadMTL(_In_z_ const wchar_t* szFileName) { + if (!szFileName) + return E_INVALIDARG; + using namespace DirectX; // Assumes MTL is in CWD along with OBJ @@ -583,6 +589,9 @@ namespace DX HRESULT LoadVBO(_In_z_ const wchar_t* szFileName) { + if (!szFileName) + return E_INVALIDARG; + using namespace DirectX; Clear();