Minor code review

This commit is contained in:
Chuck Walbourn 2018-07-06 11:57:14 -07:00
parent fcc5b33bf3
commit 6828e6387f

View File

@ -2548,7 +2548,7 @@ inline HRESULT D3DX12ParsePipelineStream(const D3D12_PIPELINE_STATE_STREAM_DESC&
{
BYTE* pStream = static_cast<BYTE*>(Desc.pPipelineStateSubobjectStream)+CurOffset;
auto SubobjectType = *reinterpret_cast<D3D12_PIPELINE_STATE_SUBOBJECT_TYPE*>(pStream);
if (SubobjectType >= D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID)
if (SubobjectType < 0 || SubobjectType >= D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID)
{
pCallbacks->ErrorUnknownSubobject(SubobjectType);
return E_INVALIDARG;