vcl/source/outdev/bitmap.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 5a86268e5dabaa5c02cf912e3793ce0f44c03a0b
Author: Armin Le Grand <armin.le.gr...@cib.de>
Date:   Mon Nov 9 14:00:50 2015 +0100

    tdf#95481 catch out-of-range access in vcl bitmap
    
    blendBitmap24 assumes bitmap is 2 lines high for doing
    interpolation. For bitmaps of height 1, really nothing to interpolate
    there. Fix cornercase by 'blending' between the very same line instead.
    
    Reviewed-on: https://gerrit.libreoffice.org/19863
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Norbert Thiebaud <nthieb...@gmail.com>
    
    Cherry-picked from 99e3ab6effa9356a1a444160e60ed8df099b15a3
    
    Change-Id: I9b94000aa563e525d0bb2418346ad2c86af26df8
    Reviewed-on: https://gerrit.libreoffice.org/19888
    Reviewed-by: Katarina Behrens <katarina.behr...@cib.de>
    Tested-by: Katarina Behrens <katarina.behr...@cib.de>

diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 2ae0236..3f415d4 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -807,11 +807,13 @@ public:
             const long nMapY  = mpMapY[nY];
             const long nMapFY = mpMapYOffset[nY];
 
-            pLine0 = pSource->GetScanline(nMapY);
-            pLine1 = pSource->GetScanline(nMapY + 1);
+             pLine0 = pSource->GetScanline(nMapY);
+            // tdf#95481 guard nMapY + 1 to be within bounds
+            pLine1 = (nMapY + 1 < pSource->Height()) ? 
pSource->GetScanline(nMapY + 1) : pLine0;
 
             pLineAlpha0 = pSourceAlpha->GetScanline(nMapY);
-            pLineAlpha1 = pSourceAlpha->GetScanline(nMapY + 1);
+            // tdf#95481 guard nMapY + 1 to be within bounds
+            pLineAlpha1 = (nMapY + 1 < pSourceAlpha->Height()) ? 
pSourceAlpha->GetScanline(nMapY + 1) : pLineAlpha0;
 
             pDestScanline = pDestination->GetScanline(nY);
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to