[MPlayer-users] All XVID encoded videos with size 624x352 cause mplayer to segfault (current and previous svn snapshots)
mike.gorchak.qnx at gmail.com
Thu Feb 7 14:43:05 CET 2013
> There are functions that require no alignment at all
> (and functions that require alignment higher than
> 16 bytes).
It was very unexpected, but I've found a bug in QNX's memalign() and
posix_memalign() functions. A patch for ffmpeg/libavutil/mem.c is
As far as I can see ffplay/ffmpeg allocates video buffers with
different strides than mplayer, so that is why ffplay works.
By the way I have found a bug in the av_malloc() function when
CONFIG_MEMALIGN_HACK is used. The code looks like:
ptr = malloc(size + ALIGN);
diff = ((~(long)ptr)&(ALIGN - 1)) + 1;
ptr = (char *)ptr + diff;
((char *)ptr)[-1] = diff;
After malloc() there is needed a check for ptr which can be ALREADY
aligned. In this case we have not to execute this line: ((char
*)ptr)[-1] = diff; which can cause a memory trashing. But better to
allocate (size+2*ALIGN) bytes and then move ptr forward for ALIGN
bytes to make sure that buffer has spare space for writting a 'diff'
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 977 bytes
Desc: not available
More information about the MPlayer-users