mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 13:20:54 +00:00
If elems count is 0 when reading array, set resulting pointer to NULL
This commit is contained in:
@@ -364,11 +364,14 @@ class Serialiser
|
||||
{
|
||||
ReadInto(numElems);
|
||||
|
||||
if(el == NULL) el = new T[numElems];
|
||||
if(numElems > 0)
|
||||
{
|
||||
if(el == NULL) el = new T[numElems];
|
||||
|
||||
size_t length = numElems*sizeof(T);
|
||||
size_t length = numElems*sizeof(T);
|
||||
|
||||
memcpy(el, ReadBytes(length), length);
|
||||
memcpy(el, ReadBytes(length), length);
|
||||
}
|
||||
}
|
||||
|
||||
Num = (size_t)numElems;
|
||||
|
||||
Reference in New Issue
Block a user