summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2004-12-05 21:39:31 +0000
committerJames Bursa <james@netsurf-browser.org>2004-12-05 21:39:31 +0000
commit6bddd0837f4cd7082b537037be267cad585d22ee (patch)
treeb1eba6518101733d294fce0eb28cdfd30e072c11
parent55c5c37ae1d046a0b8f0bc7d34eacefa735f213c (diff)
downloadnetsurf-6bddd0837f4cd7082b537037be267cad585d22ee.tar.gz
netsurf-6bddd0837f4cd7082b537037be267cad585d22ee.tar.bz2
[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
-rw-r--r--riscos/plotters.c6
1 files changed, 6 insertions, 0 deletions
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,