swscale: fix another integer overflow.

Message ID 20120229192733.A39535E0C7@aruru.libav.org
State New
Headers show

Commit Message

Janne Grunau Feb. 29, 2012, 7:27 p.m.
Module: libav
Branch: master
Commit: 791de61bbb0d2bceb1037597b310e2a4a94494fd

Author:    Ronald S. Bultje <rsbultje@gmail.com>
Committer: Ronald S. Bultje <rsbultje@gmail.com>
Date:      Tue Feb 28 18:21:31 2012 -0800

swscale: fix another integer overflow.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org

---

 libswscale/utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 3b488ca..7c89a70 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1014,7 +1014,7 @@  int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
     c->vLumBufSize= c->vLumFilterSize;
     c->vChrBufSize= c->vChrFilterSize;
     for (i=0; i<dstH; i++) {
-        int chrI= i*c->chrDstH / dstH;
+        int chrI = (int64_t) i * c->chrDstH / dstH;
         int nextSlice= FFMAX(c->vLumFilterPos[i   ] + c->vLumFilterSize - 1,
                            ((c->vChrFilterPos[chrI] + c->vChrFilterSize - 1)<<c->chrSrcVSubSample));