mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2025-01-10 12:01:10 +00:00
Fix crash with too many patch planes
This commit is contained in:
parent
5622d0b02b
commit
d5d59441db
1 changed files with 10 additions and 0 deletions
|
@ -212,8 +212,18 @@ void Patch_Parse( patchMesh_t *pPatch ){
|
||||||
// parse matrix dimensions
|
// parse matrix dimensions
|
||||||
GetToken( false );
|
GetToken( false );
|
||||||
pPatch->width = atoi( token );
|
pPatch->width = atoi( token );
|
||||||
|
if ( pPatch->width > MAX_PATCH_WIDTH ) {
|
||||||
|
Syn_Printf( "ERROR: patch has too many planes, patch width > MAX_PATCH_WIDTH (%i > %i)\n", pPatch->width, MAX_PATCH_WIDTH );
|
||||||
|
pPatch->width = MAX_PATCH_WIDTH;
|
||||||
|
abortcode = MAP_ABORTED;
|
||||||
|
}
|
||||||
GetToken( false );
|
GetToken( false );
|
||||||
pPatch->height = atoi( token );
|
pPatch->height = atoi( token );
|
||||||
|
if ( pPatch->height > MAX_PATCH_HEIGHT ) {
|
||||||
|
Syn_Printf( "ERROR: patch has too many plane points, patch height > MAX_PATCH_HEIGHT (%i > %i)\n", pPatch->height, MAX_PATCH_HEIGHT );
|
||||||
|
pPatch->height = MAX_PATCH_HEIGHT;
|
||||||
|
abortcode = MAP_ABORTED;
|
||||||
|
}
|
||||||
|
|
||||||
// ignore contents/flags/value
|
// ignore contents/flags/value
|
||||||
GetToken( false );
|
GetToken( false );
|
||||||
|
|
Loading…
Reference in a new issue