summaryrefslogtreecommitdiffstats
path: root/src/compositor/extensions/qwaylandviewporter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compositor/extensions/qwaylandviewporter.cpp')
-rw-r--r--src/compositor/extensions/qwaylandviewporter.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/compositor/extensions/qwaylandviewporter.cpp b/src/compositor/extensions/qwaylandviewporter.cpp
index b98274b1b..c34e3d0dd 100644
--- a/src/compositor/extensions/qwaylandviewporter.cpp
+++ b/src/compositor/extensions/qwaylandviewporter.cpp
@@ -149,14 +149,16 @@ void QWaylandViewporterPrivate::Viewport::checkCommittedState()
return;
}
- QRectF max = QRectF(QPointF(), m_surface->bufferSize() / m_surface->bufferScale());
- // We can't use QRectF.contains, because that would return false for values on the border
- if (max.united(source) != max) {
- wl_resource_post_error(resource()->handle, error_out_of_buffer,
- "source %f,%f, %fx%f extends outside attached buffer %fx%f",
- source.x(), source.y(), source.width(), source.height(),
- max.width(), max.height());
- return;
+ if (m_surface->bufferSize().isValid()) {
+ QRectF max = QRectF(QPointF(), m_surface->bufferSize() / m_surface->bufferScale());
+ // We can't use QRectF.contains, because that would return false for values on the border
+ if (max.united(source) != max) {
+ wl_resource_post_error(resource()->handle, error_out_of_buffer,
+ "source %f,%f, %fx%f extends outside attached buffer %fx%f",
+ source.x(), source.y(), source.width(), source.height(),
+ max.width(), max.height());
+ return;
+ }
}
}