print a warning if something allocates 0 bytes

Originally committed as revision 1307 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2002-12-04 12:42:25 +00:00
parent b92be2af42
commit 5b20b7328a
1 changed files with 3 additions and 0 deletions

View 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;