summaryrefslogtreecommitdiff
path: root/progs/demos/fire.c
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2010-01-14 22:31:04 +0000
committerJakob Bornecrantz <jakob@vmware.com>2010-01-14 22:31:04 +0000
commitb01ffb12ed82dcf435b186e2aff35e344a8a6ebe (patch)
treea62ee3f8f402f0c34ac88b5011da41a9cab8c6e3 /progs/demos/fire.c
parentffd28480560caecfb676a4bbe85a85672271e3f7 (diff)
parent252812bf15c3479d921157b9a432c7e42d3b9446 (diff)
Merge branch 'mesa_7_7_branch'
Conflicts: src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c src/gallium/auxiliary/util/Makefile src/gallium/drivers/r300/r300_state_derived.c
Diffstat (limited to 'progs/demos/fire.c')
-rw-r--r--progs/demos/fire.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/progs/demos/fire.c b/progs/demos/fire.c
index 9c351e80e5..bb912fb447 100644
--- a/progs/demos/fire.c
+++ b/progs/demos/fire.c
@@ -726,8 +726,13 @@ main(int ac, char **av)
maxage = 1.0 / dt;
- if (ac == 2)
+ if (ac == 2) {
np = atoi(av[1]);
+ if (np <= 0 || np > 1000000) {
+ fprintf(stderr, "Invalid input.\n");
+ exit(-1);
+ }
+ }
if (ac == 4) {
WIDTH = atoi(av[2]);
@@ -761,6 +766,7 @@ main(int ac, char **av)
assert(np > 0);
p = (part *) malloc(sizeof(part) * np);
+ assert(p);
for (i = 0; i < np; i++)
setnewpart(&p[i]);