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 d46c51d9cc0b95a922c0f647c373960994f15470..bc7da83efea3941e3e721cd918b3d18a562669f8 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;