mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-23 06:56:40 +00:00
Clarify some iterator checks (where asserts were used before)
* Reported by Coverity Scan - mostly this is just adding error checking where there was previously just an assert before a use of an invalid iterator.
This commit is contained in:
@@ -442,12 +442,18 @@ vector<CounterResult> VulkanReplay::FetchCounters(const vector<GPUCounter> &coun
|
||||
|
||||
// find the result we're aliasing
|
||||
auto it = std::find(ret.begin(), ret.end(), search);
|
||||
RDCASSERT(it != ret.end());
|
||||
|
||||
// duplicate the result and append
|
||||
CounterResult aliased = *it;
|
||||
aliased.eventID = cb.m_AliasEvents[i].second;
|
||||
ret.push_back(aliased);
|
||||
if(it != ret.end())
|
||||
{
|
||||
// duplicate the result and append
|
||||
CounterResult aliased = *it;
|
||||
aliased.eventID = cb.m_AliasEvents[i].second;
|
||||
ret.push_back(aliased);
|
||||
}
|
||||
else
|
||||
{
|
||||
RDCERR("Expected to find alias-target result for EID %u counter %u, but didn't",
|
||||
search.eventID, search.counterID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user