From: Vinson Lee Date: Thu, 7 Jan 2010 05:39:44 +0000 (-0800) Subject: progs/demos: Assert that input to malloc is valid. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d42467687e9de756aa3e4bca5e55f69391af3065;p=mesa.git progs/demos: Assert that input to malloc is valid. --- 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 #include #include #include @@ -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++)