[XviD-devel] mem_align.c problem
Edouard Gomez
xvid-devel@xvid.org
Wed, 27 Nov 2002 22:19:48 +0100
pikatu (pikatu@012.net.il) wrote:
> you are wrong edouard.
Yes you're right, you're patch was wrong too :-) Everything is wrong
here.
The correct patch is just to return (void*)(mem_ptr+1). The mem_ptr++
was wrong or should have been a prefixed increment ++mem_ptr. Typical
typo error when coding.
Thanks for the report.
PS: your patch was wrong because it writes outside the malloc block,
this is not important with a libc that adds boundaries before the malloc
block and after the malloc block (typical with msvc libs) but for a libc
that does not add protection boundaries, this could have lead to a
segmentation fault (memory access exception on win32)
--
Edouard Gomez