Changeset 90cad5ed in ffmpeg


Ignore:
Timestamp:
Dec 19, 2011, 3:02:51 PM (13 years ago)
Author:
Michael Niedermayer <michaelni@gmx.at>
Branches:
master
Children:
32a92d32
Parents:
9c5104e8
git-author:
Michael Niedermayer <michaelni@gmx.at> (12/19/11 14:48:47)
git-committer:
Michael Niedermayer <michaelni@gmx.at> (12/19/11 15:02:51)
Message:

swscale: Fix several (real world) integer overflows.
Fixes Ticket795
Bug Found by: Oana Stratulat

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libswscale/utils.c

    r9c5104e8 r90cad5ed  
    221221    } else if (flags&SWS_POINT) { // lame looking point sampling mode
    222222        int i;
    223         int xDstInSrc;
     223        int64_t xDstInSrc;
    224224        filterSize= 1;
    225225        FF_ALLOC_OR_GOTO(NULL, filter, dstW*sizeof(*filter)*filterSize, fail);
     
    235235    } else if ((xInc <= (1<<16) && (flags&SWS_AREA)) || (flags&SWS_FAST_BILINEAR)) { // bilinear upscale
    236236        int i;
    237         int xDstInSrc;
     237        int64_t xDstInSrc;
    238238        filterSize= 2;
    239239        FF_ALLOC_OR_GOTO(NULL, filter, dstW*sizeof(*filter)*filterSize, fail);
     
    247247            //bilinear upscale / linear interpolate / area averaging
    248248            for (j=0; j<filterSize; j++) {
    249                 int64_t coeff= fone - FFABS((xx<<16) - xDstInSrc)*(fone>>16);
     249                int64_t coeff= fone - FFABS(((int64_t)xx<<16) - xDstInSrc)*(fone>>16);
    250250                if (coeff<0) coeff=0;
    251251                filter[i*filterSize + j]= coeff;
     
    255255        }
    256256    } else {
    257         int xDstInSrc;
     257        int64_t xDstInSrc;
    258258        int sizeFactor;
    259259
     
    284284            (*filterPos)[i]= xx;
    285285            for (j=0; j<filterSize; j++) {
    286                 int64_t d= ((int64_t)FFABS((xx<<17) - xDstInSrc))<<13;
     286                int64_t d= (FFABS(((int64_t)xx<<17) - xDstInSrc))<<13;
    287287                double floatd;
    288288                int64_t coeff;
Note: See TracChangeset for help on using the changeset viewer.