Kaynağa Gözat

progs/demos: Assert that input to malloc is valid.

tags/mesa-7.7-1
Vinson Lee 16 yıl önce
ebeveyn
işleme
d42467687e
1 değiştirilmiş dosya ile 2 ekleme ve 0 silme
  1. 2
    0
      progs/demos/fire.c

+ 2
- 0
progs/demos/fire.c Dosyayı Görüntüle

@@ -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++)

Loading…
İptal
Kaydet