[MPlayer-dev-eng] [PATCH] deobfuscate vf_scale

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Dec 18 11:21:31 CET 2005


Hi,
On Sat, Dec 17, 2005 at 07:13:36PM -0500, Rich Felker wrote:
> On Sat, Dec 17, 2005 at 09:36:33PM +0200, Oded Shimon wrote:
> > Index: libmpcodecs/vf_scale.c
> > ===================================================================
> > RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_scale.c,v
> > retrieving revision 1.58
> > diff -u -r1.58 vf_scale.c
> > --- libmpcodecs/vf_scale.c	6 Mar 2005 21:15:24 -0000	1.58
> > +++ libmpcodecs/vf_scale.c	7 Mar 2005 11:48:55 -0000
> > @@ -144,12 +144,12 @@
> >  	}
> >      }
> >  
> > -    if (vf->priv->w < 0 && (-vf->priv->w & 8)) {
> > -      vf->priv->w = -(-vf->priv->w & ~8);
> > +    if (vf->priv->w <= -8) {
> > +      vf->priv->w += 8;
> >        round_w = 1;
> >      }
> > -    if (vf->priv->h < 0 && (-vf->priv->h & 8)) {
> > -      vf->priv->h = -(-vf->priv->h & ~8);
> > +    if (vf->priv->h <= -8) {
> > +      vf->priv->h += 8;
> >        round_h = 1;
> 
> This is broken. The idea was to treat 8 as a bitflag so that more
> flags could be added in the future. Your senseless change breaks that!

Even though I partially agree, I must admit you can still easily add
more flags if you start parsing with the most significant one.
All in all, I guess it doesn't matter much for now.

Greetings,
Reimar Döffinger




More information about the MPlayer-dev-eng mailing list