projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
45ac10f
)
progs/demos: Assert that input to malloc is valid.
author
Vinson Lee
<vlee@vmware.com>
Thu, 7 Jan 2010 05:39:44 +0000
(21:39 -0800)
committer
Vinson Lee
<vlee@vmware.com>
Thu, 7 Jan 2010 05:39:44 +0000
(21:39 -0800)
progs/demos/fire.c
patch
|
blob
|
history
diff --git
a/progs/demos/fire.c
b/progs/demos/fire.c
index dd70f6141dba4817452073aeb7a55cbf45fff744..f30b893dbf38d7e1a0964266567899e16a65ad5e 100644
(file)
--- 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++)