[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/krita/core
From:       Casper Boemann <cbr () boemann ! dk>
Date:       2006-03-09 14:52:05
Message-ID: 1141915925.303074.10957.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 516998 by boemann:

more buffer overflow prevention


 M  +5 -7      kis_transform_worker.cc  


--- trunk/koffice/krita/core/kis_transform_worker.cc #516997:516998
@@ -259,10 +259,6 @@
     else
         dstLen = srcLen * scale / scaleDenom;
 
-
-    //allocate space for weights and colors
-    const Q_UINT8 *colors[100];
-
     // Calculate extra length (in each side) needed due to shear
     Q_INT32 extraLen = (support+256)>>8;
 
@@ -272,7 +268,9 @@
     Q_UINT8 *tmpSel = new Q_UINT8[srcLen+2*extraLen];
     Q_CHECK_PTR(tmpSel);
 
-/**********/
+    //allocate space for colors
+    const Q_UINT8 **colors = new const Q_UINT8 *[2*support+1];
+
     // Precalculate weights
     filterValues *filterWeights = new filterValues[256];
 
@@ -307,10 +305,10 @@
             }
         }
 //printf("  sum2 =%d\n",sum);
-        
+
         filterWeights[center].numWeights = span;
     }
-/**********/
+
     for(lineNum = firstLine; lineNum < firstLine+numLines; lineNum++)
     {
         if(scale < 0)
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic