a la norme et sans leaks, manque le parsing

This commit is contained in:
hugogogo
2021-07-23 16:28:12 +02:00
parent 04ad40b58d
commit 3b8a88de23
130 changed files with 8652 additions and 211 deletions

View File

@@ -108,9 +108,13 @@ void *mlx_int_new_image(t_xvar *xvar,int width, int height,int format)
{
t_img *img;
if (!(img = malloc(sizeof(*img))) ||
!(img->data = malloc((width+32)*height*4)))
if (!(img = malloc(sizeof(*img))))
return ((void *)0);
if (!(img->data = malloc((width+32)*height*4)))
{
free(img);
return ((void *)0);
}
bzero(img->data,(width+32)*height*4);
img->image = XCreateImage(xvar->display,xvar->visual,xvar->depth,format,0,
img->data,width,height,32,0);