mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-28 18:31:40 +00:00
Fix overlap check in rdcarray::insert
This fixes an infinite when attempting to call `insert(0, NULL, 0)` on an empty `rdcarray`. The new behaviour also triggers a copy when the inserted interval overlaps the `rdcarray`'s *allocated* memory (rather than just the currently used prefixed). Change-Id: I075827d50a24d0560ca391224820334e467a41f5
This commit is contained in:
committed by
Baldur Karlsson
parent
722d24a96e
commit
b8fbdf399b
@@ -439,7 +439,7 @@ public:
|
||||
|
||||
void insert(size_t offs, const T *el, size_t count)
|
||||
{
|
||||
if(el + count >= begin() && end() >= el)
|
||||
if(elems < el + count && el < elems + allocatedCount)
|
||||
{
|
||||
// we're inserting from ourselves, so if we did this blindly we'd potentially change the
|
||||
// contents of the inserted range while doing the insertion.
|
||||
|
||||
Reference in New Issue
Block a user