From: Ash Tyndall Date: Fri, 21 Oct 2011 12:13:07 +0000 (+0800) Subject: (no commit message) X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=b6ab27a06daefe58dfb7ec4738f91f9879388083;p=atyndall%2Fcits2231.git --- diff --git a/helper.c b/helper.c index f6ecc8c..9da3e1d 100644 --- a/helper.c +++ b/helper.c @@ -309,6 +309,11 @@ int addSceneObject(int id) { sceneObjs[nObjects].rotation.parameter = 0; sceneObjs[nObjects].rotation.vect = (vector*)calloc( 3, sizeof(vector[0]) ); + if ( sceneObjs[nObjects].scale == NULL || sceneObjs[nObjects].rotation.vect == NULL ) { + sprintf(stderr, "Could not allocate memory for Scene Object! Shutting down!\n"); + exit(EXIT_FAILURE); + } + nObjects += 1; // New object in scene return nObjects;