print a warning if something allocates 0 bytes
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 4 Dec 2002 12:42:25 +0000 (12:42 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 4 Dec 2002 12:42:25 +0000 (12:42 +0000)
Originally committed as revision 1307 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/utils.c

index d46c51d..bc7da83 100644 (file)
@@ -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;