fix crash

This commit is contained in:
Timothee "TTimo" Besset 2015-09-27 15:48:42 -05:00
parent d5af21b669
commit 48d03ea905

View file

@ -28,6 +28,7 @@
//
#include "plugin.h"
#include <assert.h>
// cmdlib
extern void ExtractFileName( const char *path, char *dest, size_t size );
@ -202,7 +203,7 @@ void Patch_Parse( patchMesh_t *pPatch ){
GetToken( true );
str = new char[strlen( token ) + 10];
strcpy( str, "textures/" );
Q_strncpyz( str + 9, token, sizeof( str ) - 9 );
Q_strncpyz( str + 9, token, strlen( token ) + 10 - 9 );
pPatch->pShader = QERApp_Shader_ForName( str );
pPatch->d_texture = pPatch->pShader->getTexture();
delete [] str;