diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2015-11-09 14:00:50 +0100 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2015-11-10 07:19:01 +0000 |
commit | 99e3ab6effa9356a1a444160e60ed8df099b15a3 (patch) | |
tree | 81fdf09b3aad034de730e60ca2d076d0598e310b /vcl/source | |
parent | b2831b5bb26ae8cbb2b1796f390e1b1b90eb4202 (diff) |
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.
Change-Id: I9b94000aa563e525d0bb2418346ad2c86af26df8
Reviewed-on: https://gerrit.libreoffice.org/19863
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/outdev/bitmap.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index a2e30aa4e70e..adddcaa84dfd 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -810,11 +810,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); |