Kaydet (Commit) 99e3ab6e authored tarafından Armin Le Grand's avatar Armin Le Grand Kaydeden (comit) Norbert Thiebaud

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/19863Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNorbert Thiebaud <nthiebaud@gmail.com>
üst b2831b5b
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment