mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-26 17:31:42 +00:00
Protect against overflow in MemRefs
Change-Id: I70d4143bd5bcdefe4f5f0a610aec6ff0321112f5
This commit is contained in:
committed by
Baldur Karlsson
parent
4ea32eac43
commit
b5f40e68e8
@@ -1329,6 +1329,7 @@ struct MemRefs
|
||||
inline MemRefs(VkDeviceSize offset, VkDeviceSize size, FrameRefType refType)
|
||||
: initializedLiveRes(NULL)
|
||||
{
|
||||
size = RDCMIN(size, UINT64_MAX - offset);
|
||||
rangeRefs.update(offset, offset + size, refType, ComposeFrameRefs);
|
||||
}
|
||||
template <typename Compose>
|
||||
@@ -1346,6 +1347,7 @@ template <typename Compose>
|
||||
FrameRefType MemRefs::Update(VkDeviceSize offset, VkDeviceSize size, FrameRefType refType,
|
||||
Compose comp)
|
||||
{
|
||||
size = RDCMIN(size, UINT64_MAX - offset);
|
||||
FrameRefType maxRefType = eFrameRef_None;
|
||||
rangeRefs.update(offset, offset + size, refType,
|
||||
[&maxRefType, comp](FrameRefType oldRef, FrameRefType newRef) -> FrameRefType {
|
||||
|
||||
Reference in New Issue
Block a user