]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/mem.c
log: fix compilation failure on mingw due to reference to undefined set_color256
[ffmpeg] / libavutil / mem.c
index 385ace0702e1fa980b53ccd6fdf0f5a85c2c8e9f..8ec226b17aee2cb57e873ed83bc12f175ce244aa 100644 (file)
@@ -125,8 +125,14 @@ void *av_malloc(size_t size)
 #else
     ptr = malloc(size);
 #endif
-    if(!ptr && !size)
+    if(!ptr && !size) {
+        size = 1;
         ptr= av_malloc(1);
+    }
+#if CONFIG_MEMORY_POISONING
+    if (ptr)
+        memset(ptr, 0x2a, size);
+#endif
     return ptr;
 }