print a warning if something allocates 0 bytes

Originally committed as revision 1307 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Michael Niedermayer 22 years ago
parent b92be2af42
commit 5b20b7328a
  1. 3
      libavcodec/utils.c

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

Loading…
Cancel
Save