mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2025-01-18 21:51:37 +00:00
Fix range checks for numBorders in CM_AddFacetBevels
Found by Coverity.
This commit is contained in:
parent
9f57fea0ee
commit
ee2541efee
1 changed files with 12 additions and 2 deletions
|
@ -876,7 +876,10 @@ void CM_AddFacetBevels( facet_t *facet ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( i == facet->numBorders ) {
|
if ( i == facet->numBorders ) {
|
||||||
if (facet->numBorders > 4 + 6 + 16) Com_Printf("ERROR: too many bevels\n");
|
if ( facet->numBorders >= 4 + 6 + 16 ) {
|
||||||
|
Com_Printf( "ERROR: too many bevels\n" );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
facet->borderPlanes[facet->numBorders] = CM_FindPlane2(plane, &flipped);
|
facet->borderPlanes[facet->numBorders] = CM_FindPlane2(plane, &flipped);
|
||||||
facet->borderNoAdjust[facet->numBorders] = 0;
|
facet->borderNoAdjust[facet->numBorders] = 0;
|
||||||
facet->borderInward[facet->numBorders] = flipped;
|
facet->borderInward[facet->numBorders] = flipped;
|
||||||
|
@ -938,7 +941,10 @@ void CM_AddFacetBevels( facet_t *facet ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( i == facet->numBorders ) {
|
if ( i == facet->numBorders ) {
|
||||||
if (facet->numBorders > 4 + 6 + 16) Com_Printf("ERROR: too many bevels\n");
|
if ( facet->numBorders >= 4 + 6 + 16 ) {
|
||||||
|
Com_Printf( "ERROR: too many bevels\n" );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
facet->borderPlanes[facet->numBorders] = CM_FindPlane2(plane, &flipped);
|
facet->borderPlanes[facet->numBorders] = CM_FindPlane2(plane, &flipped);
|
||||||
|
|
||||||
for ( k = 0 ; k < facet->numBorders ; k++ ) {
|
for ( k = 0 ; k < facet->numBorders ; k++ ) {
|
||||||
|
@ -976,6 +982,10 @@ void CM_AddFacetBevels( facet_t *facet ) {
|
||||||
|
|
||||||
#ifndef BSPC
|
#ifndef BSPC
|
||||||
//add opposite plane
|
//add opposite plane
|
||||||
|
if ( facet->numBorders >= 4 + 6 + 16 ) {
|
||||||
|
Com_Printf( "ERROR: too many bevels\n" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
facet->borderPlanes[facet->numBorders] = facet->surfacePlane;
|
facet->borderPlanes[facet->numBorders] = facet->surfacePlane;
|
||||||
facet->borderNoAdjust[facet->numBorders] = 0;
|
facet->borderNoAdjust[facet->numBorders] = 0;
|
||||||
facet->borderInward[facet->numBorders] = qtrue;
|
facet->borderInward[facet->numBorders] = qtrue;
|
||||||
|
|
Loading…
Reference in a new issue