From 5b20b7328a6b0d0286b6d0f1975fbd417ae010eb Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 4 Dec 2002 12:42:25 +0000 Subject: print a warning if something allocates 0 bytes Originally committed as revision 1307 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/utils.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavcodec/utils.c') diff --git a/libavcodec/utils.c b/libavcodec/utils.c index d46c51d9cc..bc7da83efe 100644 --- a/libavcodec/utils.c +++ b/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; -- cgit v1.2.3