summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2012-08-05 22:59:09 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2012-08-05 22:59:09 +0100
commitb777549cc2ed940d65934eb34d4aedb0652037fa (patch)
tree53393d1ed4152340ba2442e418b9c21470e3b2e9 /amiga
parentff8d7d974c74e139f06791bef2aa85af22e0f122 (diff)
downloadnetsurf-b777549cc2ed940d65934eb34d4aedb0652037fa.tar.gz
netsurf-b777549cc2ed940d65934eb34d4aedb0652037fa.tar.bz2
avoid crash if pen list is not set
Diffstat (limited to 'amiga')
-rwxr-xr-xamiga/gui.c1
-rwxr-xr-xamiga/plotters.c11
-rwxr-xr-xamiga/plotters.h2
3 files changed, 8 insertions, 6 deletions
diff --git a/amiga/gui.c b/amiga/gui.c
index 6278f283d..03ca8a9b8 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -3523,6 +3523,7 @@ void ami_do_redraw(struct gui_window_2 *g)
}
else
{
+ browserglob.shared_pens = &g->shared_pens;
temprp = browserglob.rp;
browserglob.rp = g->win->RPort;
clip.x0 = bbox->Left;
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 0078f0c8e..c5020daec 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -246,11 +246,12 @@ static ULONG ami_plot_obtain_pen(struct MinList *shared_pens, ULONG colour)
if(pen == -1) LOG(("WARNING: Cannot allocate pen for ABGR:%lx", colour));
- if(node = (struct ami_plot_pen *)AllocVec(sizeof(struct ami_plot_pen),
- MEMF_PRIVATE | MEMF_CLEAR)) {
- AddTail((struct List *)shared_pens, (struct Node *)node);
- }
-
+ if(shared_pens != NULL) {
+ if(node = (struct ami_plot_pen *)AllocVec(sizeof(struct ami_plot_pen),
+ MEMF_PRIVATE | MEMF_CLEAR)) {
+ AddTail((struct List *)shared_pens, (struct Node *)node);
+ }
+ }
return pen;
}
diff --git a/amiga/plotters.h b/amiga/plotters.h
index e1d2d048d..b51aad2b0 100755
--- a/amiga/plotters.h
+++ b/amiga/plotters.h
@@ -35,7 +35,7 @@ struct gui_globals
struct Rectangle rect;
struct MinList *shared_pens;
bool locked_layers;
- #ifdef NS_AMIGA_CAIRO
+#ifdef NS_AMIGA_CAIRO
cairo_surface_t *surface;
cairo_t *cr;
#endif