diff options
author | Vinson Lee <[email protected]> | 2010-01-06 21:39:44 -0800 |
---|---|---|
committer | Vinson Lee <[email protected]> | 2010-01-06 21:39:44 -0800 |
commit | d42467687e9de756aa3e4bca5e55f69391af3065 (patch) | |
tree | e1df5c743fed666b07b3b574921fc2d0a3cd3a79 /progs/demos | |
parent | 45ac10fe6a9c01aec9b7245f9a5621402842f466 (diff) |
progs/demos: Assert that input to malloc is valid.
Diffstat (limited to 'progs/demos')
-rw-r--r-- | progs/demos/fire.c | 2 |
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++) |