[FFmpeg-devel] [PATCH][RFC] variable frame sizes

Michael Niedermayer michaelni
Thu Jun 4 19:59:16 CEST 2009


On Tue, Jun 02, 2009 at 08:21:38AM -0700, Eric Buehl wrote:
> >
> > > +            /* keep bands proportional to the frame size */
> > > +            ost->topBand    = MAKE_EVEN(ist->st->codec->height *
> > ost->original_topBand / ost->original_height);
> > > +            ost->bottomBand = MAKE_EVEN(ist->st->codec->height *
> > ost->original_bottomBand / ost->original_height);
> > > +            ost->leftBand   = MAKE_EVEN(ist->st->codec->width *
> > ost->original_leftBand / ost->original_width);
> > > +            ost->rightBand  = MAKE_EVEN(ist->st->codec->width *
> > ost->original_rightBand / ost->original_width);
> >
> > The multiply can overflow
> >
> > also its not guranteed that the new *Band values fit in 32bit, one
> > probably could generate a mallicious stream where this is not the case
> > (this would even affect float code probably)
> >
> 
> Would it be acceptable to multiply into a 64 bit int, divide, and then
> truncate back to 32?

i dont think thats sufficient to avoid problems, have you thought about
what happens when the result does not fit in 32bit ?

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali
-------------- 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/20090604/cf441e89/attachment.pgp>



More information about the ffmpeg-devel mailing list