From 0dbc9060a69e4d64a01a6fefdabb78acc32fab95 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 29 Apr 2015 17:46:03 +0200 Subject: [PATCH] Cleanup: make grumpy asan happy and do not use `new []` to allocate data freed by `free()`. Probably nothing crucial, but asan build would crash on that stupid glitch... Annoying. --- source/blender/imbuf/intern/dds/DirectDrawSurface.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp index 15c8d86d61c..6bf82776afe 100644 --- a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp +++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp @@ -60,6 +60,7 @@ #include #include // printf +#include // malloc #include // sqrt #include @@ -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);