summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@digia.com>2014-10-10 17:26:27 +0200
committerPierre Rossi <pierre.rossi@gmail.com>2014-10-10 17:41:48 +0200
commit739bfbb55df666c7fb975fb847bbd3f129b88eba (patch)
tree510a62f915847ac178e2d15bc896fb15a5277080
parent3c42bb02d4a38af925958707398a179b0c94fea9 (diff)
Bounds check the zoom factor before we pass it along.
As it turns out failing to do so can mess up the page state. Change-Id: I8cc785b01c73bde5443bdb78554d7b3809d96afe Reviewed-by: Andras Becsi <andras.becsi@digia.com>
-rw-r--r--src/core/web_contents_adapter.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 3533c074..4129e8c3 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -612,6 +612,8 @@ void WebContentsAdapter::serializeNavigationHistory(QDataStream &output)
void WebContentsAdapter::setZoomFactor(qreal factor)
{
Q_D(WebContentsAdapter);
+ if (factor < content::kMinimumZoomFactor || factor > content::kMaximumZoomFactor)
+ return;
content::HostZoomMap::SetZoomLevel(d->webContents.get(), content::ZoomFactorToZoomLevel(static_cast<double>(factor)));
}