Skip to content

Commit c4aefda

Browse files
author
devsh
committed
protect against IPreHashed assets which don't have a valid precomputed hash
1 parent 0f2f626 commit c4aefda

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/nbl/video/utilities/CAssetConverter.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,8 @@ bool CAssetConverter::CHashCache::hash_impl::operator()(lookup_t<ICPUBottomLevel
11531153
hasher << lookup.patch->hostBuild;
11541154
hasher << lookup.patch->compactAfterBuild;
11551155
// finally the contents
1156+
if (lookup.asset->getContentHash()==NoContentHash)
1157+
return false;
11561158
hasher << lookup.asset->getContentHash();
11571159
return true;
11581160
}
@@ -1232,6 +1234,8 @@ bool CAssetConverter::CHashCache::hash_impl::operator()(lookup_t<ICPUImage> look
12321234
creationFlags |= create_flags_t::ECF_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT;
12331235
hasher << creationFlags;
12341236
// finally the contents
1237+
if (lookup.asset->getContentHash()==NoContentHash)
1238+
return false;
12351239
hasher << lookup.asset->getContentHash();
12361240
return true;
12371241
}
@@ -1335,6 +1339,8 @@ bool CAssetConverter::CHashCache::hash_impl::operator()(lookup_t<ICPUPipelineCac
13351339
if (entry.first.meta)
13361340
hasher.update(entry.first.meta->data(),entry.first.meta->size());
13371341
}
1342+
if (lookup.asset->getContentHash()==NoContentHash)
1343+
return false;
13381344
hasher << lookup.asset->getContentHash();
13391345
return true;
13401346
}

0 commit comments

Comments
 (0)