Skip to content

Commit 5cd47af

Browse files
authored
[GEN][ZH] Fix crash in W3DBufferManager when a shadow buffer limit is exceeded (#879)
1 parent be0f696 commit 5cd47af

File tree

4 files changed

+132
-100
lines changed

4 files changed

+132
-100
lines changed

Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DBufferManager.cpp

Lines changed: 58 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ Bool W3DBufferManager::ReAcquireResources(void)
210210
}
211211

212212
/**Searches through previously allocated vertex buffer slots and returns a matching type. If none found,
213-
creates a new slot and adds it to the pool. Returns an integer slotId used to reference the VB.
214-
Returns -1 in case of failure.
213+
creates a new slot and adds it to the pool. Returns a pointer to the VB slot.
214+
Returns NULL in case of failure.
215215
*/
216216
W3DBufferManager::W3DVertexBufferSlot *W3DBufferManager::getSlot(VBM_FVF_TYPES fvfType, Int size)
217217
{
@@ -222,9 +222,14 @@ W3DBufferManager::W3DVertexBufferSlot *W3DBufferManager::getSlot(VBM_FVF_TYPES f
222222
size = (size + (MIN_SLOT_SIZE-1)) & (~(MIN_SLOT_SIZE-1));
223223
Int sizeIndex = (size >> MIN_SLOT_SIZE_SHIFT)-1;
224224

225-
DEBUG_ASSERTCRASH(sizeIndex < MAX_VB_SIZES && size, ("Allocating too large vertex buffer slot"));
225+
DEBUG_ASSERTCRASH(sizeIndex < MAX_VB_SIZES && size > 0, ("Allocating too large vertex buffer slot"));
226+
// TheSuperHackers @bugfix xezon 18/05/2025 Protect against indexing slots beyond the max size.
227+
// This will happen when a mesh is too complex to draw shadows with.
228+
if (sizeIndex >= MAX_VB_SIZES || size <= 0) {
229+
return NULL;
230+
}
226231

227-
if ((vbSlot=m_W3DVertexBufferSlots[fvfType][sizeIndex]) != 0)
232+
if ((vbSlot=m_W3DVertexBufferSlots[fvfType][sizeIndex]) != NULL)
228233
{ //found a previously allocated slot matching required size
229234
m_W3DVertexBufferSlots[fvfType][sizeIndex]=vbSlot->m_nextSameSize;
230235
if (vbSlot->m_nextSameSize)
@@ -260,31 +265,32 @@ W3DBufferManager::W3DVertexBufferSlot * W3DBufferManager::allocateSlotStorage(VB
260265
W3DVertexBufferSlot *vbSlot;
261266
// Int sizeIndex = (size >> MIN_SLOT_SIZE_SHIFT)-1;
262267

263-
DEBUG_ASSERTCRASH(m_numEmptySlotsAllocated < MAX_NUMBER_SLOTS, ("Nore more VB Slots"));
268+
DEBUG_ASSERTCRASH(m_numEmptySlotsAllocated < MAX_NUMBER_SLOTS, ("No more VB Slots"));
269+
// TheSuperHackers @bugfix xezon 18/05/2025 Protect against allocating slot storage beyond the max size.
270+
// This will happen when there are too many meshes in the scene to draw shadows with.
271+
if (m_numEmptySlotsAllocated >= MAX_NUMBER_SLOTS) {
272+
return NULL;
273+
}
264274

265275
pVB=m_W3DVertexBuffers[fvfType];
266276
while (pVB)
267277
{
268278
if ((pVB->m_size - pVB->m_startFreeIndex) >= size)
269279
{ //found enough free space in this vertex buffer
270-
271-
if (m_numEmptySlotsAllocated < MAX_NUMBER_SLOTS)
272-
{ //we're allowing more slots to be allocated.
273-
vbSlot=&m_W3DVertexBufferEmptySlots[m_numEmptySlotsAllocated];
274-
vbSlot->m_size=size;
275-
vbSlot->m_start=pVB->m_startFreeIndex;
276-
vbSlot->m_VB=pVB;
277-
//Link to VB list of slots
278-
vbSlot->m_nextSameVB=pVB->m_usedSlots;
279-
vbSlot->m_prevSameVB=NULL; //this will be the new head
280-
if (pVB->m_usedSlots)
281-
pVB->m_usedSlots->m_prevSameVB=vbSlot;
282-
vbSlot->m_prevSameSize=vbSlot->m_nextSameSize=NULL;
283-
pVB->m_usedSlots=vbSlot;
284-
pVB->m_startFreeIndex += size;
285-
m_numEmptySlotsAllocated++;
286-
return vbSlot;
287-
}
280+
vbSlot=&m_W3DVertexBufferEmptySlots[m_numEmptySlotsAllocated];
281+
vbSlot->m_size=size;
282+
vbSlot->m_start=pVB->m_startFreeIndex;
283+
vbSlot->m_VB=pVB;
284+
//Link to VB list of slots
285+
vbSlot->m_nextSameVB=pVB->m_usedSlots;
286+
vbSlot->m_prevSameVB=NULL; //this will be the new head
287+
if (pVB->m_usedSlots)
288+
pVB->m_usedSlots->m_prevSameVB=vbSlot;
289+
vbSlot->m_prevSameSize=vbSlot->m_nextSameSize=NULL;
290+
pVB->m_usedSlots=vbSlot;
291+
pVB->m_startFreeIndex += size;
292+
m_numEmptySlotsAllocated++;
293+
return vbSlot;
288294
}
289295
pVB = pVB->m_nextVB;
290296
}
@@ -324,8 +330,8 @@ W3DBufferManager::W3DVertexBufferSlot * W3DBufferManager::allocateSlotStorage(VB
324330

325331
//******************************** Index Buffer code ******************************************************
326332
/**Searches through previously allocated index buffer slots and returns a matching type. If none found,
327-
creates a new slot and adds it to the pool. Returns an integer slotId used to reference the VB.
328-
Returns -1 in case of failure.
333+
creates a new slot and adds it to the pool. Returns a pointer to the IB slot.
334+
Returns NULL in case of failure.
329335
*/
330336
W3DBufferManager::W3DIndexBufferSlot *W3DBufferManager::getSlot(Int size)
331337
{
@@ -336,9 +342,14 @@ W3DBufferManager::W3DIndexBufferSlot *W3DBufferManager::getSlot(Int size)
336342
size = (size + (MIN_SLOT_SIZE-1)) & (~(MIN_SLOT_SIZE-1));
337343
Int sizeIndex = (size >> MIN_SLOT_SIZE_SHIFT)-1;
338344

339-
DEBUG_ASSERTCRASH(sizeIndex < MAX_IB_SIZES && size, ("Allocating too large index buffer slot"));
345+
DEBUG_ASSERTCRASH(sizeIndex < MAX_IB_SIZES && size > 0, ("Allocating too large index buffer slot"));
346+
// TheSuperHackers @bugfix xezon 18/05/2025 Protect against indexing slots beyond the max size.
347+
// This will happen when a mesh is too complex to draw shadows with.
348+
if (sizeIndex >= MAX_IB_SIZES || size <= 0) {
349+
return NULL;
350+
}
340351

341-
if ((ibSlot=m_W3DIndexBufferSlots[sizeIndex]) != 0)
352+
if ((ibSlot=m_W3DIndexBufferSlots[sizeIndex]) != NULL)
342353
{ //found a previously allocated slot matching required size
343354
m_W3DIndexBufferSlots[sizeIndex]=ibSlot->m_nextSameSize;
344355
if (ibSlot->m_nextSameSize)
@@ -374,31 +385,32 @@ W3DBufferManager::W3DIndexBufferSlot * W3DBufferManager::allocateSlotStorage(Int
374385
W3DIndexBufferSlot *ibSlot;
375386
// Int sizeIndex = (size >> MIN_SLOT_SIZE_SHIFT)-1;
376387

377-
DEBUG_ASSERTCRASH(m_numEmptyIndexSlotsAllocated < MAX_NUMBER_SLOTS, ("Nore more IB Slots"));
388+
DEBUG_ASSERTCRASH(m_numEmptyIndexSlotsAllocated < MAX_NUMBER_SLOTS, ("No more IB Slots"));
389+
// TheSuperHackers @bugfix xezon 18/05/2025 Protect against allocating slot storage beyond the max size.
390+
// This will happen when there are too many meshes in the scene to draw shadows with.
391+
if (m_numEmptyIndexSlotsAllocated >= MAX_NUMBER_SLOTS) {
392+
return NULL;
393+
}
378394

379395
pIB=m_W3DIndexBuffers;
380396
while (pIB)
381397
{
382398
if ((pIB->m_size - pIB->m_startFreeIndex) >= size)
383399
{ //found enough free space in this index buffer
384-
385-
if (m_numEmptyIndexSlotsAllocated < MAX_NUMBER_SLOTS)
386-
{ //we're allowing more slots to be allocated.
387-
ibSlot=&m_W3DIndexBufferEmptySlots[m_numEmptyIndexSlotsAllocated];
388-
ibSlot->m_size=size;
389-
ibSlot->m_start=pIB->m_startFreeIndex;
390-
ibSlot->m_IB=pIB;
391-
//Link to IB list of slots
392-
ibSlot->m_nextSameIB=pIB->m_usedSlots;
393-
ibSlot->m_prevSameIB=NULL; //this will be the new head
394-
if (pIB->m_usedSlots)
395-
pIB->m_usedSlots->m_prevSameIB=ibSlot;
396-
ibSlot->m_prevSameSize=ibSlot->m_nextSameSize=NULL;
397-
pIB->m_usedSlots=ibSlot;
398-
pIB->m_startFreeIndex += size;
399-
m_numEmptyIndexSlotsAllocated++;
400-
return ibSlot;
401-
}
400+
ibSlot=&m_W3DIndexBufferEmptySlots[m_numEmptyIndexSlotsAllocated];
401+
ibSlot->m_size=size;
402+
ibSlot->m_start=pIB->m_startFreeIndex;
403+
ibSlot->m_IB=pIB;
404+
//Link to IB list of slots
405+
ibSlot->m_nextSameIB=pIB->m_usedSlots;
406+
ibSlot->m_prevSameIB=NULL; //this will be the new head
407+
if (pIB->m_usedSlots)
408+
pIB->m_usedSlots->m_prevSameIB=ibSlot;
409+
ibSlot->m_prevSameSize=ibSlot->m_nextSameSize=NULL;
410+
pIB->m_usedSlots=ibSlot;
411+
pIB->m_startFreeIndex += size;
412+
m_numEmptyIndexSlotsAllocated++;
413+
return ibSlot;
402414
}
403415
pIB = pIB->m_nextIB;
404416
}

Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2808,17 +2808,21 @@ void W3DVolumetricShadow::constructVolumeVB( Vector3 *lightPosObject,Real shadow
28082808
vertexCount);
28092809

28102810
DEBUG_ASSERTCRASH(vbSlot != NULL, ("Can't allocate vertex buffer slot for shadow volume"));
2811-
2812-
DEBUG_ASSERTCRASH(vbSlot->m_size >= vertexCount,("Overflowing Shadow Vertex Buffer Slot"));
2811+
if (vbSlot != NULL)
2812+
{
2813+
DEBUG_ASSERTCRASH(vbSlot->m_size >= vertexCount,("Overflowing Shadow Vertex Buffer Slot"));
2814+
}
28132815

28142816
DEBUG_ASSERTCRASH(m_shadowVolume[ volumeIndex ][meshIndex]->GetNumPolygon() == 0,("Updating Existing Static Shadow Volume"));
28152817

28162818
DEBUG_ASSERTCRASH(m_shadowVolumeIB[ volumeIndex ][meshIndex] == NULL,("Updating Existing Static Index Buffer Shadow"));
28172819
ibSlot=m_shadowVolumeIB[ volumeIndex ][meshIndex] = TheW3DBufferManager->getSlot(polygonCount*3);
28182820

28192821
DEBUG_ASSERTCRASH(ibSlot != NULL, ("Can't allocate index buffer slot for shadow volume"));
2820-
2821-
DEBUG_ASSERTCRASH(ibSlot->m_size >= (polygonCount*3),("Overflowing Shadow Index Buffer Slot"));
2822+
if (ibSlot != NULL)
2823+
{
2824+
DEBUG_ASSERTCRASH(ibSlot->m_size >= (polygonCount*3),("Overflowing Shadow Index Buffer Slot"));
2825+
}
28222826

28232827
if (!ibSlot || !vbSlot)
28242828
{ //could not allocate storage to hold buffers

GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DBufferManager.cpp

Lines changed: 58 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ Bool W3DBufferManager::ReAcquireResources(void)
210210
}
211211

212212
/**Searches through previously allocated vertex buffer slots and returns a matching type. If none found,
213-
creates a new slot and adds it to the pool. Returns an integer slotId used to reference the VB.
214-
Returns -1 in case of failure.
213+
creates a new slot and adds it to the pool. Returns a pointer to the VB slot.
214+
Returns NULL in case of failure.
215215
*/
216216
W3DBufferManager::W3DVertexBufferSlot *W3DBufferManager::getSlot(VBM_FVF_TYPES fvfType, Int size)
217217
{
@@ -222,9 +222,14 @@ W3DBufferManager::W3DVertexBufferSlot *W3DBufferManager::getSlot(VBM_FVF_TYPES f
222222
size = (size + (MIN_SLOT_SIZE-1)) & (~(MIN_SLOT_SIZE-1));
223223
Int sizeIndex = (size >> MIN_SLOT_SIZE_SHIFT)-1;
224224

225-
DEBUG_ASSERTCRASH(sizeIndex < MAX_VB_SIZES && size, ("Allocating too large vertex buffer slot"));
225+
DEBUG_ASSERTCRASH(sizeIndex < MAX_VB_SIZES && size > 0, ("Allocating too large vertex buffer slot"));
226+
// TheSuperHackers @bugfix xezon 18/05/2025 Protect against indexing slots beyond the max size.
227+
// This will happen when a mesh is too complex to draw shadows with.
228+
if (sizeIndex >= MAX_VB_SIZES || size <= 0) {
229+
return NULL;
230+
}
226231

227-
if ((vbSlot=m_W3DVertexBufferSlots[fvfType][sizeIndex]) != 0)
232+
if ((vbSlot=m_W3DVertexBufferSlots[fvfType][sizeIndex]) != NULL)
228233
{ //found a previously allocated slot matching required size
229234
m_W3DVertexBufferSlots[fvfType][sizeIndex]=vbSlot->m_nextSameSize;
230235
if (vbSlot->m_nextSameSize)
@@ -260,31 +265,32 @@ W3DBufferManager::W3DVertexBufferSlot * W3DBufferManager::allocateSlotStorage(VB
260265
W3DVertexBufferSlot *vbSlot;
261266
// Int sizeIndex = (size >> MIN_SLOT_SIZE_SHIFT)-1;
262267

263-
DEBUG_ASSERTCRASH(m_numEmptySlotsAllocated < MAX_NUMBER_SLOTS, ("Nore more VB Slots"));
268+
DEBUG_ASSERTCRASH(m_numEmptySlotsAllocated < MAX_NUMBER_SLOTS, ("No more VB Slots"));
269+
// TheSuperHackers @bugfix xezon 18/05/2025 Protect against allocating slot storage beyond the max size.
270+
// This will happen when there are too many meshes in the scene to draw shadows with.
271+
if (m_numEmptySlotsAllocated >= MAX_NUMBER_SLOTS) {
272+
return NULL;
273+
}
264274

265275
pVB=m_W3DVertexBuffers[fvfType];
266276
while (pVB)
267277
{
268278
if ((pVB->m_size - pVB->m_startFreeIndex) >= size)
269279
{ //found enough free space in this vertex buffer
270-
271-
if (m_numEmptySlotsAllocated < MAX_NUMBER_SLOTS)
272-
{ //we're allowing more slots to be allocated.
273-
vbSlot=&m_W3DVertexBufferEmptySlots[m_numEmptySlotsAllocated];
274-
vbSlot->m_size=size;
275-
vbSlot->m_start=pVB->m_startFreeIndex;
276-
vbSlot->m_VB=pVB;
277-
//Link to VB list of slots
278-
vbSlot->m_nextSameVB=pVB->m_usedSlots;
279-
vbSlot->m_prevSameVB=NULL; //this will be the new head
280-
if (pVB->m_usedSlots)
281-
pVB->m_usedSlots->m_prevSameVB=vbSlot;
282-
vbSlot->m_prevSameSize=vbSlot->m_nextSameSize=NULL;
283-
pVB->m_usedSlots=vbSlot;
284-
pVB->m_startFreeIndex += size;
285-
m_numEmptySlotsAllocated++;
286-
return vbSlot;
287-
}
280+
vbSlot=&m_W3DVertexBufferEmptySlots[m_numEmptySlotsAllocated];
281+
vbSlot->m_size=size;
282+
vbSlot->m_start=pVB->m_startFreeIndex;
283+
vbSlot->m_VB=pVB;
284+
//Link to VB list of slots
285+
vbSlot->m_nextSameVB=pVB->m_usedSlots;
286+
vbSlot->m_prevSameVB=NULL; //this will be the new head
287+
if (pVB->m_usedSlots)
288+
pVB->m_usedSlots->m_prevSameVB=vbSlot;
289+
vbSlot->m_prevSameSize=vbSlot->m_nextSameSize=NULL;
290+
pVB->m_usedSlots=vbSlot;
291+
pVB->m_startFreeIndex += size;
292+
m_numEmptySlotsAllocated++;
293+
return vbSlot;
288294
}
289295
pVB = pVB->m_nextVB;
290296
}
@@ -324,8 +330,8 @@ W3DBufferManager::W3DVertexBufferSlot * W3DBufferManager::allocateSlotStorage(VB
324330

325331
//******************************** Index Buffer code ******************************************************
326332
/**Searches through previously allocated index buffer slots and returns a matching type. If none found,
327-
creates a new slot and adds it to the pool. Returns an integer slotId used to reference the VB.
328-
Returns -1 in case of failure.
333+
creates a new slot and adds it to the pool. Returns a pointer to the IB slot.
334+
Returns NULL in case of failure.
329335
*/
330336
W3DBufferManager::W3DIndexBufferSlot *W3DBufferManager::getSlot(Int size)
331337
{
@@ -336,9 +342,14 @@ W3DBufferManager::W3DIndexBufferSlot *W3DBufferManager::getSlot(Int size)
336342
size = (size + (MIN_SLOT_SIZE-1)) & (~(MIN_SLOT_SIZE-1));
337343
Int sizeIndex = (size >> MIN_SLOT_SIZE_SHIFT)-1;
338344

339-
DEBUG_ASSERTCRASH(sizeIndex < MAX_IB_SIZES && size, ("Allocating too large index buffer slot"));
345+
DEBUG_ASSERTCRASH(sizeIndex < MAX_IB_SIZES && size > 0, ("Allocating too large index buffer slot"));
346+
// TheSuperHackers @bugfix xezon 18/05/2025 Protect against indexing slots beyond the max size.
347+
// This will happen when a mesh is too complex to draw shadows with.
348+
if (sizeIndex >= MAX_IB_SIZES || size <= 0) {
349+
return NULL;
350+
}
340351

341-
if ((ibSlot=m_W3DIndexBufferSlots[sizeIndex]) != 0)
352+
if ((ibSlot=m_W3DIndexBufferSlots[sizeIndex]) != NULL)
342353
{ //found a previously allocated slot matching required size
343354
m_W3DIndexBufferSlots[sizeIndex]=ibSlot->m_nextSameSize;
344355
if (ibSlot->m_nextSameSize)
@@ -374,31 +385,32 @@ W3DBufferManager::W3DIndexBufferSlot * W3DBufferManager::allocateSlotStorage(Int
374385
W3DIndexBufferSlot *ibSlot;
375386
// Int sizeIndex = (size >> MIN_SLOT_SIZE_SHIFT)-1;
376387

377-
DEBUG_ASSERTCRASH(m_numEmptyIndexSlotsAllocated < MAX_NUMBER_SLOTS, ("Nore more IB Slots"));
388+
DEBUG_ASSERTCRASH(m_numEmptyIndexSlotsAllocated < MAX_NUMBER_SLOTS, ("No more IB Slots"));
389+
// TheSuperHackers @bugfix xezon 18/05/2025 Protect against allocating slot storage beyond the max size.
390+
// This will happen when there are too many meshes in the scene to draw shadows with.
391+
if (m_numEmptyIndexSlotsAllocated >= MAX_NUMBER_SLOTS) {
392+
return NULL;
393+
}
378394

379395
pIB=m_W3DIndexBuffers;
380396
while (pIB)
381397
{
382398
if ((pIB->m_size - pIB->m_startFreeIndex) >= size)
383399
{ //found enough free space in this index buffer
384-
385-
if (m_numEmptyIndexSlotsAllocated < MAX_NUMBER_SLOTS)
386-
{ //we're allowing more slots to be allocated.
387-
ibSlot=&m_W3DIndexBufferEmptySlots[m_numEmptyIndexSlotsAllocated];
388-
ibSlot->m_size=size;
389-
ibSlot->m_start=pIB->m_startFreeIndex;
390-
ibSlot->m_IB=pIB;
391-
//Link to IB list of slots
392-
ibSlot->m_nextSameIB=pIB->m_usedSlots;
393-
ibSlot->m_prevSameIB=NULL; //this will be the new head
394-
if (pIB->m_usedSlots)
395-
pIB->m_usedSlots->m_prevSameIB=ibSlot;
396-
ibSlot->m_prevSameSize=ibSlot->m_nextSameSize=NULL;
397-
pIB->m_usedSlots=ibSlot;
398-
pIB->m_startFreeIndex += size;
399-
m_numEmptyIndexSlotsAllocated++;
400-
return ibSlot;
401-
}
400+
ibSlot=&m_W3DIndexBufferEmptySlots[m_numEmptyIndexSlotsAllocated];
401+
ibSlot->m_size=size;
402+
ibSlot->m_start=pIB->m_startFreeIndex;
403+
ibSlot->m_IB=pIB;
404+
//Link to IB list of slots
405+
ibSlot->m_nextSameIB=pIB->m_usedSlots;
406+
ibSlot->m_prevSameIB=NULL; //this will be the new head
407+
if (pIB->m_usedSlots)
408+
pIB->m_usedSlots->m_prevSameIB=ibSlot;
409+
ibSlot->m_prevSameSize=ibSlot->m_nextSameSize=NULL;
410+
pIB->m_usedSlots=ibSlot;
411+
pIB->m_startFreeIndex += size;
412+
m_numEmptyIndexSlotsAllocated++;
413+
return ibSlot;
402414
}
403415
pIB = pIB->m_nextIB;
404416
}

GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2952,17 +2952,21 @@ void W3DVolumetricShadow::constructVolumeVB( Vector3 *lightPosObject,Real shadow
29522952
vertexCount);
29532953

29542954
DEBUG_ASSERTCRASH(vbSlot != NULL, ("Can't allocate vertex buffer slot for shadow volume"));
2955-
2956-
DEBUG_ASSERTCRASH(vbSlot->m_size >= vertexCount,("Overflowing Shadow Vertex Buffer Slot"));
2955+
if (vbSlot != NULL)
2956+
{
2957+
DEBUG_ASSERTCRASH(vbSlot->m_size >= vertexCount,("Overflowing Shadow Vertex Buffer Slot"));
2958+
}
29572959

29582960
DEBUG_ASSERTCRASH(m_shadowVolume[ volumeIndex ][meshIndex]->GetNumPolygon() == 0,("Updating Existing Static Shadow Volume"));
29592961

29602962
DEBUG_ASSERTCRASH(m_shadowVolumeIB[ volumeIndex ][meshIndex] == NULL,("Updating Existing Static Index Buffer Shadow"));
29612963
ibSlot=m_shadowVolumeIB[ volumeIndex ][meshIndex] = TheW3DBufferManager->getSlot(polygonCount*3);
29622964

29632965
DEBUG_ASSERTCRASH(ibSlot != NULL, ("Can't allocate index buffer slot for shadow volume"));
2964-
2965-
DEBUG_ASSERTCRASH(ibSlot->m_size >= (polygonCount*3),("Overflowing Shadow Index Buffer Slot"));
2966+
if (ibSlot != NULL)
2967+
{
2968+
DEBUG_ASSERTCRASH(ibSlot->m_size >= (polygonCount*3),("Overflowing Shadow Index Buffer Slot"));
2969+
}
29662970

29672971
if (!ibSlot || !vbSlot)
29682972
{ //could not allocate storage to hold buffers

0 commit comments

Comments
 (0)