[dxbc] Check if the signature is nullptr before using it

Fixes a crash in The Witcher 3.
This commit is contained in:
Philip Rebohle 2018-03-23 21:38:21 +01:00
parent 31772af4a5
commit 0ab27aa4e3
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
1 changed files with 9 additions and 7 deletions

View File

@ -49,13 +49,15 @@ namespace dxvk {
DxbcClipCullInfo DxbcAnalyzer::getClipCullInfo(const Rc<DxbcIsgn>& sgn) const {
DxbcClipCullInfo result;
for (auto e = sgn->begin(); e != sgn->end(); e++) {
const uint32_t componentCount = e->componentMask.popCount();
if (e->systemValue == DxbcSystemValue::ClipDistance)
result.numClipPlanes += componentCount;
if (e->systemValue == DxbcSystemValue::CullDistance)
result.numCullPlanes += componentCount;
if (sgn != nullptr) {
for (auto e = sgn->begin(); e != sgn->end(); e++) {
const uint32_t componentCount = e->componentMask.popCount();
if (e->systemValue == DxbcSystemValue::ClipDistance)
result.numClipPlanes += componentCount;
if (e->systemValue == DxbcSystemValue::CullDistance)
result.numCullPlanes += componentCount;
}
}
return result;