[FFmpeg-devel] [PATCH][RFC] variable frame sizes
Eric Buehl
eric.buehl
Tue Jun 2 17:21:38 CEST 2009
>
> > + /* 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?
More information about the ffmpeg-devel
mailing list