[XviD-devel] problem in mem_align.c

pikatu xvid-devel@xvid.org
Tue, 26 Nov 2002 19:05:48 +0000


Hi, 

It seems to me that the code in mem_align.c is a bit buggy, 
shouldn't it be:

	if (!alignment) {

		/* We have not to satisfy any alignment */
		if ((mem_ptr = (uint8_t *) malloc(size + 1)) != NULL) {

			/* Store (mem_ptr - "real allocated memory") in *(mem_ptr-1) */
			*mem_ptr = 1;
			printf("\nI am here\n");
			/* Return the mem_ptr pointer */
			return (void *) ++mem_ptr;

		}