[FFmpeg-devel] [PATCH] lsws: prevent overflow in sws_init_context()

Stefano Sabatini stefano.sabatini-lala at poste.it
Mon Apr 25 22:49:59 CEST 2011


On date Monday 2011-04-25 02:29:38 +0200, Michael Niedermayer encoded:
> On Mon, Apr 25, 2011 at 01:28:26AM +0200, Stefano Sabatini wrote:
> > In the loop:
> >     for (i=0; i<dstH; i++) {
> >         int chrI= i*c->chrDstH / dstH;
> > 
> > when i*c->chrDstH > INT_MAX this leads to an integer overflow, which
> > results in a negative value for chrI and in out-of-buffer reads. The
> > overflow is avoided by forcing int64_t arithmetic by casting i to
> > int64_t.
> > 
> > Fix crash, and trac issue #72.
> 
> ok & thx

Applied.
-- 
FFmpeg = Furious and Freak Marvellous Patchable Epic Governor


More information about the ffmpeg-devel mailing list