Cleanup: make grumpy asan happy and do not use `new []` to allocate data freed by...
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 29 Apr 2015 15:46:03 +0000 (17:46 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 29 Apr 2015 15:46:03 +0000 (17:46 +0200)
Probably nothing crucial, but asan build would crash on that stupid glitch... Annoying.

source/blender/imbuf/intern/dds/DirectDrawSurface.cpp

index 15c8d86d61c2f8316b8625e8cec942d7298cf253..6bf82776afe20c331cb6bc1e6aa3758dfc69d02b 100644 (file)
@@ -60,6 +60,7 @@
 #include <PixelFormat.h>
 
 #include <stdio.h> // printf
+#include <stdlib.h>  // malloc
 #include <math.h>  // sqrt
 #include <sys/types.h>
 
@@ -1147,7 +1148,7 @@ void* DirectDrawSurface::readData(uint &rsize)
        uint size = stream.size - header_size;
        rsize = size;
 
-       unsigned char *data = new unsigned char[size];
+       unsigned char *data = (unsigned char *)malloc(sizeof(*data) * size);
 
        stream.seek(header_size);
        mem_read(stream, data, size);