From 6bddd0837f4cd7082b537037be267cad585d22ee Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sun, 5 Dec 2004 21:39:31 +0000 Subject: [project @ 2004-12-05 21:39:31 by bursa] Return an error for invalid clip rectangles to ro_plot_clip(). svn path=/import/netsurf/; revision=1382 --- riscos/plotters.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'riscos') diff --git a/riscos/plotters.c b/riscos/plotters.c index e25c5ddcc..e258d047c 100644 --- a/riscos/plotters.c +++ b/riscos/plotters.c @@ -243,6 +243,12 @@ bool ro_plot_clip(int clip_x0, int clip_y0, clip_x1 = ro_plot_origin_x + clip_x1 * 2 - 1; clip_y1 = ro_plot_origin_y - clip_y1 * 2; + if (clip_x1 < clip_x0 || clip_y0 < clip_y1) { + LOG(("bad clip rectangle %i %i %i %i", + clip_x0, clip_y0, clip_x1, clip_y1)); + return false; + } + error = xos_set_graphics_window(); if (error) { LOG(("xos_set_graphics_window: 0x%x: %s", error->errnum, -- cgit v1.2.3