[FFmpeg-devel] [PATCH] mingw memalign hack fix

David DeHaven dave
Thu Nov 27 01:17:52 CET 2008


>>> SSE2 code was segfaulting on my MinGW builds, turns out blocks being
>>> av_realloc'd were losing their alignment. This patch fixes that.
>
> av_realloc() makes no gurantee about alignment

Then it shouldn't be used for blocks that are being used in MMX/SSE  
optimized code :)


> also several people have already tried to implement a av_realloc()  
> that
> maintains alignment so far with no luck.
> yours looks exploitable ...

At worst you just allocate a new block and copy the data... that's  
what realloc does when it can't extend the block it's been given.  
Ideally this would be fixed in MinGW but I really don't want to dive  
into that pile...

Actually there's something else I didn't catch, the previous patch  
will only realloc up to the previous diff more bytes and not a full 16  
bytes like av_malloc does.

-DrD-

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mingw-av_realloc-fix.patch
Type: application/octet-stream
Size: 1046 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081126/bd851360/attachment.obj>
-------------- next part --------------






More information about the ffmpeg-devel mailing list