summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2010-01-06 21:39:44 -0800
committerVinson Lee <[email protected]>2010-01-06 21:39:44 -0800
commitd42467687e9de756aa3e4bca5e55f69391af3065 (patch)
treee1df5c743fed666b07b3b574921fc2d0a3cd3a79
parent45ac10fe6a9c01aec9b7245f9a5621402842f466 (diff)
progs/demos: Assert that input to malloc is valid.
-rw-r--r--progs/demos/fire.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/progs/demos/fire.c b/progs/demos/fire.c
index dd70f6141db..f30b893dbf3 100644
--- a/progs/demos/fire.c
+++ b/progs/demos/fire.c
@@ -6,6 +6,7 @@
* Humanware s.r.l.
*/
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
@@ -759,6 +760,7 @@ main(int ac, char **av)
glFogfv(GL_FOG_COLOR, fogcolor);
glFogf(GL_FOG_DENSITY, 0.1);
+ assert(np > 0);
p = (part *) malloc(sizeof(part) * np);
for (i = 0; i < np; i++)