[MPlayer-dev-eng] a52 codec with divx causing segfault in mplayer

Michael Niedermayer michaelni at gmx.at
Wed Aug 10 12:05:03 CEST 2005


Hi

On Wed, Aug 10, 2005 at 10:54:11AM +0200, Reimar Döffinger wrote:
> Hi,
> On Tue, Aug 09, 2005 at 08:45:01PM +0200, Aurelien Jacobs wrote:
> > I wasn't able to reproduce the problem but I think the attached patch
> > could fix it.
> > Could you please test this patch ?
> > 
> > Aurel
> > Index: imdct.c
> > ===================================================================
> > RCS file: /cvsroot/mplayer/main/liba52/imdct.c,v
> > retrieving revision 1.28
> > diff -u -r1.28 imdct.c
> > --- imdct.c	5 Aug 2005 13:33:49 -0000	1.28
> > +++ imdct.c	9 Aug 2005 11:46:06 -0000
> > @@ -813,7 +813,7 @@
> >  		"sub $16, %%"REG_D"			\n\t"
> >  		"jnc 1b				 	\n\t"
> >  		"pop %%"REG_BP"				\n\t"//no we didnt touch ebp *g*
> > -		:: "r" (data), "r" (buf)
> > +		:: "b" (data), "c" (buf)
> >  		: "%"REG_S, "%"REG_D, "%"REG_a, "%"REG_d
> 
> Hmm... well I guess the real problem here is the (IMHO) broken way to
> use REG_BP without gcc knowing about it... Can somebody elaborate why it
> was done like that (push + pop instead of putting it into the clobber
> list)?

gcc ignores ebp if its on the clobber list
try to run the following
int main(){
    int i;

    asm (
        "xorl %%ebp, %%ebp\n\t"
        "movl %0, %%ebp\n\t"
        :: "m" (i)
        : "%ebp"
    );
    return 0;
}

hmm, guess i should report it even though i know it will be marked invalid
or ignored or if iam really lucky they make gcc fail with a error message

[...]
-- 
Michael




More information about the MPlayer-dev-eng mailing list