]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/picomodel/pm_ms3d.c
gcc: appease the hardening warnings
[xonotic/netradiant.git] / libs / picomodel / pm_ms3d.c
index 378265f30a5504d59206c95b08d6f43fb103bce7..13a5f277f39d0a350cae8b3f997b9e80bd594f4f 100644 (file)
@@ -33,6 +33,7 @@
    ----------------------------------------------------------------------------- */
 
 /* dependencies */
+#include <assert.h>
 #include "picointernal.h"
 #include "globaldefs.h"
 
@@ -228,6 +229,7 @@ static picoModel_t *_ms3d_load( PM_PARAMS_LOAD ){
 
        /* get number of vertices */
        bufptr = GetWord( bufptr,&numVerts );
+       assert(bufptr);
        ptrToVerts = bufptr;
 
 #ifdef DEBUG_PM_MS3D
@@ -291,6 +293,7 @@ static picoModel_t *_ms3d_load( PM_PARAMS_LOAD ){
        }
        /* get number of groups */
        bufptr = GetWord( bufptr,&numGroups );
+       assert(bufptr);
 //     ptrToGroups = bufptr;
 
 #ifdef DEBUG_PM_MS3D
@@ -332,6 +335,7 @@ static picoModel_t *_ms3d_load( PM_PARAMS_LOAD ){
 
                        /* get triangle index */
                        bufptr = GetWord( bufptr,(int *)&triangleIndex );
+                       assert(bufptr);
 
                        /* get ptr to triangle data */
                        triangle = (TMsTriangle *)( ptrToTris + ( sizeof( TMsTriangle ) * triangleIndex ) );
@@ -376,6 +380,7 @@ static picoModel_t *_ms3d_load( PM_PARAMS_LOAD ){
        }
        /* get number of materials */
        bufptr = GetWord( bufptr,&numMaterials );
+       assert(bufptr);
 
 #ifdef DEBUG_PM_MS3D
        printf( "NumMaterials: %d\n",numMaterials );