X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=helper.c;h=bd5f37b7f1f6a97d8396a69e1e3f2c2c846c635c;hb=bc1e4447312bdfb7fd6bc13cfbec364b96d5806e;hp=f6ecc8c13dc3445b388ab55963553d65eef22060;hpb=f1c86cda52b306cdfbe62e1776eb38cff811f47b;p=atyndall%2Fcits2231.git diff --git a/helper.c b/helper.c index f6ecc8c..bd5f37b 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 ) { + fprintf(stderr, "Could not allocate memory for Scene Object! Shutting down!\n"); + exit(EXIT_FAILURE); + } + nObjects += 1; // New object in scene return nObjects;