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

Michael Niedermayer michaelni
Thu Nov 27 18:43:07 CET 2008


On Wed, Nov 26, 2008 at 04:17:52PM -0800, David DeHaven wrote:
>
>>>> 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 :)

Well until you tell us where the failing code is, i dont see how we could
fix it.
Also a reproduceable test case and full bugreport being mandatory for
any patch that claims to fix a bug.


>
>
>> 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.

your code is still totally broken, the data in tha array after the call is
just not what was there before.

[..]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct awnser.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081127/e0c1cb9d/attachment.pgp>



More information about the ffmpeg-devel mailing list