[SCM] libav/wheezy-security: swscale: Fix an undefined behaviour

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 1 21:36:14 UTC 2014


The following commit has been merged in the wheezy-security branch:
commit 7fa72700298107fe756311ecb4dee5270ff12d35
Author: Luca Barbato <lu_zero at gentoo.org>
Date:   Fri May 2 00:21:23 2014 +0200

    swscale: Fix an undefined behaviour
    
    Prevent a division by zero down the codepath.
    
    Sample-Id: 00001721-google
    Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
    CC: libav-stable at libav.org

diff --git a/libswscale/utils.c b/libswscale/utils.c
index f3a5012..b4a7485 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -269,7 +269,7 @@ static int initFilter(int16_t **outFilter, int32_t **filterPos, int *outFilterSi
 
         xDstInSrc= xInc - 0x10000;
         for (i=0; i<dstW; i++) {
-            int xx= (xDstInSrc - ((filterSize-2)<<16)) / (1<<17);
+            int xx = (xDstInSrc - ((int64_t)(filterSize - 2) << 16)) / (1 << 17);
             int j;
             (*filterPos)[i]= xx;
             for (j=0; j<filterSize; j++) {

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list