changeset 908:2ac4caad5ca6 libavcodec

print a warning if something allocates 0 bytes
author michaelni
date Wed, 04 Dec 2002 12:42:25 +0000
parents b3ae2aba4b24
children 8ae1e4c24e91
files utils.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Wed Dec 04 12:36:18 2002 +0000
+++ b/utils.c	Wed Dec 04 12:42:25 2002 +0000
@@ -23,6 +23,9 @@
 void *av_mallocz(unsigned int size)
 {
     void *ptr;
+    
+    if(size == 0) fprintf(stderr, "Warning, allocating 0 bytes\n");
+    
     ptr = av_malloc(size);
     if (!ptr)
         return NULL;