From dfad215d1b5fffdb8b8cbeee02f176f7a28f0d65 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sun, 21 Nov 2004 22:49:02 +0000 Subject: [project @ 2004-11-21 22:49:02 by bursa] Fix crash when certain MNGs are opened in a new browser window. svn path=/import/netsurf/; revision=1368 --- riscos/window.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/riscos/window.c b/riscos/window.c index a413edc2b..42062718b 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -513,6 +513,11 @@ void gui_window_update_box(struct gui_window *g, int clip_x0, clip_y0, clip_x1, clip_y1; os_error *error; + /* in some cases an update can be triggered before a content has fully + * loaded, so current_content is 0 */ + if (!c) + return; + update.w = g->window; update.box.x0 = floorf(data->redraw.x * 2 * g->option.scale); update.box.y0 = -ceilf((data->redraw.y + data->redraw.height) * 2 * @@ -915,7 +920,7 @@ void ro_gui_window_open(struct gui_window *g, wimp_open *open) g->reformat_pending = true; gui_reformat_pending = true; } - + g->old_width = width; g->old_height = height; -- cgit v1.2.3