[FFmpeg-devel] [PATCH 2/2] tta/x86: add ff_ttafilter_process_dec_{ssse3, sse4}

Michael Niedermayer michaelni at gmx.at
Wed Feb 12 00:26:07 CET 2014


On Tue, Feb 11, 2014 at 02:07:54PM +0100, Christophe Gisquet wrote:
> 2014-02-11 Paul B Mahol <onemda at gmail.com>:
> >> Well, I don't feel confident, but it makes sense it works. I don't
> >> know what opinion other people have, nor a way to mitigate a potential
> >> issue. I fear leaving a comment along the declaration of the TTA*
> >> struct about the need for a total size multiple of 16, and making sure
> >> the tables addresses in TTAFilter remain aligned might help, but not
> >> failproof at all.
> >
> > What about all those ALIGNED macros that are put into c code of various structs?
> 
> I don't know how that works for a structure inside a structure (rinse
> and repeat) that is (av_)malloc'ed, even more so if it's an array of
> structs. I would wager it only means "reserve padding" so that the
> address relative to the start of the struct/stack is aligned as
> instructed.
> 
> If the top-level structure size is not a multiple of 16, I don't think
> that'll help for instance.
> 
> I'm not about to inspect the ISO C specs.

the align directives should work no matter how you nest structs
that is the top level struct should become padded to size n*16 if it
contains something needing 16byte alignment

thats IMO, i have not tested this but would consider it a bug if a
compiler didnt do it.

just consider the equivalent case of int32 on an architecture that
requires int32 to be aligned, here too the compiler must be able to
pull this trick of or plain C code could fail

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

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140212/aefb75e8/attachment.asc>


More information about the ffmpeg-devel mailing list