[FFmpeg-devel] Stack variables alignment check in libavcodec/dsputil.c

Uoti Urpala uoti.urpala
Sun Aug 12 02:44:57 CEST 2007


On Sat, 2007-08-11 at 20:14 -0300, Ramiro Polla wrote:
> Michael Niedermayer wrote:
> >> -int ff_check_alignment(void){
> >> +int attribute_align_arg ff_check_alignment(void){
> >>      static int did_fail=0;
> >>      DECLARE_ALIGNED_16(int, aligned);

> > this IS wrong, it defeats the purpose of the function which is to check that
> > the stack of the caller is properly aligned

> Well, if attribute_align_arg isn't added to this function, it will still 
> print out the terrorizing message but it won't ever crash due to 
> misalignment.

Why does it print the message then? And if the stack is misaligned at
that point (unless realigned when entering the function) why does it not
crash? Are there some call paths "from outside" which end up calling
this check without aligning the stack but do not call any code which
would absolutely need alignment?





More information about the ffmpeg-devel mailing list