summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk3
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/gtk3')
-rw-r--r--vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 95aa313329b2..6bfad00b3170 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -1002,8 +1002,10 @@ void GtkSalGraphics::renderAreaToPix( cairo_t *cr,
unsigned char *src = data.get();
src += (int)ay * nStride + (int)ax * 3;
+ awidth = MIN (region->width, size.getX() - ax);
+ aheight = MIN (region->height, size.getY() - ay);
- for (int y = 0; y < size.getY(); ++y)
+ for (int y = 0; y < aheight; ++y)
{
for (int x = 0; x < awidth && y < aheight; ++x)
{