Skip to content

Commit

Permalink
Fix in BlockMetadata_Linear::CreateAllocationRequest for too large al…
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-sawicki-a committed Mar 5, 2024
1 parent 5b87b9a commit c29f274
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/D3D12MemAlloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4034,6 +4034,10 @@ bool BlockMetadata_Linear::CreateAllocationRequest(
D3D12MA_ASSERT(allocSize > 0 && "Cannot allocate empty block!");
D3D12MA_ASSERT(pAllocationRequest != NULL);
D3D12MA_HEAVY_ASSERT(Validate());

if(allocSize > GetSize())
return false;

pAllocationRequest->size = allocSize;
return upperAddress ?
CreateAllocationRequest_UpperAddress(
Expand Down

0 comments on commit c29f274

Please sign in to comment.