[Libreoffice-commits] online.git: loleaflet/src

Dennis Francis (via logerrit) logerrit at kemper.freedesktop.org
Sun Jul 5 08:01:26 UTC 2020


 loleaflet/src/layer/tile/CalcTileLayer.js |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 21ded7f081494cbfb107ee1f4d6b6c3839664fd6
Author:     Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Fri May 15 23:12:16 2020 +0530
Commit:     Dennis Francis <dennis.francis at collabora.com>
CommitDate: Sun Jul 5 10:01:03 2020 +0200

    enforce bound-checks on setViewArea()
    
    Change-Id: Ic129181095c301ce27421bac5d3f1f94d1932248
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97947
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Dennis Francis <dennis.francis at collabora.com>

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js
index b7ad0a7f5..0b540acdf 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -1040,6 +1040,10 @@ L.SheetDimension = L.Class.extend({
 	// computes element index from tile-twips position.
 	_getIndexFromTileTwipsPos: function (pos) {
 		var span = this._visibleSizes.getSpanDataByCustomDataField(pos, 'postiletwips');
+		if (span === undefined) {
+			// enforce limits.
+			return (pos >= 0) ? this._maxIndex : 0;
+		}
 		var elementCount = span.end - span.start + 1;
 		var posStart = ((span.data.posdevpx - span.data.sizedev * elementCount) /
 			this._devPixelsPerCssPixel * this._twipsPerCSSPixel);


More information about the Libreoffice-commits mailing list