[Mplayer-cvslog] CVS: main spudec.c,1.30,1.31

Fredrik Kuivinen freku045 at student.liu.se
Wed May 29 10:25:19 CEST 2002


On Wed, May 29, 2002 at 02:33:06AM +0200, pl wrote:
> +  } else {
> +    // We'll get NULL if 0 byte is requested and it's not an error
> +    if (this->stride && this->height ) {
> +      fprintf(stderr,"Fatal: update_spu: malloc requested %d bytes\n", 2 * this->stride * this->height);
> +    }

malloc will return a pointer != NULL if 0 bytes is requested (and the
allocation did succeed). A simple test program shows this. The
Linux manual page isn't very clear on the issue; the OpenBSD one
describes it though 
(http://www.openbsd.org/cgi-bin/man.cgi?query=malloc&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html).

/ Fredrik




More information about the MPlayer-cvslog mailing list