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

List:       kde-kimageshop
Subject:    Patch for KisBrush::scaleImage
From:       Sven Langkamp <sven.langkamp () gmail ! com>
Date:       2010-03-28 18:49:15
Message-ID: 478b087a1003281149k73d1b14dw3ae1fbcd64e69008 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

I have been trying to investigate
https://bugs.kde.org/show_bug.cgi?id=229512
I have attached a patch from which I think that it fixes the crash, though
I'm not sure as I don't completely grasp it and therefor post of for review.

Without the patch it might happen that we pass a negative index to scanline.



Sven

[Attachment #5 (text/html)]

Hi,<br><br>I have been trying to investigate <a \
href="https://bugs.kde.org/show_bug.cgi?id=229512">https://bugs.kde.org/show_bug.cgi?id=229512</a><br>I \
have attached a patch from which I think that it fixes the crash, though I&#39;m not \
sure as I don&#39;t completely grasp it and therefor post of for review.<br> \
<br>Without the patch it might happen that we pass a negative index to \
scanline.<br><br><br><br>Sven<br>

--001636284ca26b476e0482e0da21--


["scaleImage.diff" (text/x-patch)]

Index: kis_brush.cpp
===================================================================
--- kis_brush.cpp	(Revision 1108131)
+++ kis_brush.cpp	(Arbeitskopie)
@@ -694,7 +694,7 @@
         srcY -= 0.5;
         int topY = static_cast<int>(srcY);
         if (srcY < 0) {
-            topY--;
+            topY++;
         }
 
         QRgb *dstPixel = reinterpret_cast<QRgb *>(dstImage.scanLine(dstY));
@@ -712,7 +712,7 @@
             int leftX = static_cast<int>(srcX);
 
             if (srcX < 0) {
-                leftX--;
+                leftX++;
             }
 
             double xInterp = srcX - leftX;
@@ -808,7 +808,7 @@
             int topY = static_cast<int>(srcY);
 
             if (srcY < 0) {
-                topY--;
+                topY++;
             }
 
             QRgb *dstPixel = reinterpret_cast<QRgb *>(scaledImage.scanLine(dstY));
@@ -824,7 +824,7 @@
                 int leftX = static_cast<int>(srcX);
 
                 if (srcX < 0) {
-                    leftX--;
+                    leftX++;
                 }
 
                 double xInterp = srcX - leftX;


_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop


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

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