diff --git a/Source/GmmLib/Resource/GmmResourceInfoCommon.cpp b/Source/GmmLib/Resource/GmmResourceInfoCommon.cpp index acc279e..a1c2744 100644 --- a/Source/GmmLib/Resource/GmmResourceInfoCommon.cpp +++ b/Source/GmmLib/Resource/GmmResourceInfoCommon.cpp @@ -447,6 +447,13 @@ GMM_STATUS GMM_STDCALL GmmLib::GmmResourceInfoCommon::Create(Context &GmmLibCont pPlatform = GMM_OVERRIDE_PLATFORM_INFO(&Surf, GetGmmLibContext()); pTextureCalc = GMM_OVERRIDE_TEXTURE_CALC(&Surf, GetGmmLibContext()); + if (!pTextureCalc) + { + Status = GMM_ERROR; + GMM_ASSERTDPF(0, "Texture Calculation pointer is NULL."); + goto ERROR_CASE; + } + #if defined(__GMM_KMD__) || !defined(_WIN32) if(!CreateParams.Flags.Info.ExistingSysMem) #else diff --git a/Source/GmmLib/Resource/GmmResourceInfoCommonEx.cpp b/Source/GmmLib/Resource/GmmResourceInfoCommonEx.cpp index 825318a..f44ecdd 100644 --- a/Source/GmmLib/Resource/GmmResourceInfoCommonEx.cpp +++ b/Source/GmmLib/Resource/GmmResourceInfoCommonEx.cpp @@ -443,6 +443,12 @@ uint8_t GMM_STDCALL GmmLib::GmmResourceInfoCommon::ValidateParams() pPlatformResource = GMM_OVERRIDE_PLATFORM_INFO(&Surf, GetGmmLibContext()); pTextureCalc = GMM_OVERRIDE_TEXTURE_CALC(&Surf, GetGmmLibContext()); + if (!pTextureCalc) + { + GMM_ASSERTDPF(0, "Texture Calculation pointer is NULL."); + goto ERROR_CASE; + } + __GMM_ASSERT(!( Surf.Flags.Gpu.Query && !Surf.Flags.Info.Cacheable)); // Why query not set as cacheable? If not cacheable, what keeps from stolen memory (because STORE_DWORD/PIPE_CONTROL/etc. targets can't be in stolen)? diff --git a/Source/GmmLib/Resource/GmmRestrictions.cpp b/Source/GmmLib/Resource/GmmRestrictions.cpp index 6d05d55..789c72b 100644 --- a/Source/GmmLib/Resource/GmmRestrictions.cpp +++ b/Source/GmmLib/Resource/GmmRestrictions.cpp @@ -76,7 +76,10 @@ void GmmLib::GmmResourceInfoCommon::GetRestrictions(__GMM_BUFFER_TYPE &Restricti GMM_TEXTURE_CALC *pTextureCalc = NULL; pTextureCalc = GMM_OVERRIDE_TEXTURE_CALC(&Surf, GetGmmLibContext()); - pTextureCalc->GetResRestrictions(&Surf, Restrictions); + if (pTextureCalc) + { + pTextureCalc->GetResRestrictions(&Surf, Restrictions); + } GMM_DPF_EXIT; }