summaryrefslogtreecommitdiff
path: root/riscos/save_draw.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2008-06-01 00:15:53 +0000
committerJames Bursa <james@netsurf-browser.org>2008-06-01 00:15:53 +0000
commit70c7b81c2fd459c87697216b69c2bd17e5d3086c (patch)
treec01c67c82c9a80e9f0ac2cf3697ea25257da98cf /riscos/save_draw.c
parent21a3c99d3dcf20e13cdcf16fda6f01f6e6a3a1b3 (diff)
downloadnetsurf-70c7b81c2fd459c87697216b69c2bd17e5d3086c.tar.gz
netsurf-70c7b81c2fd459c87697216b69c2bd17e5d3086c.tar.bz2
Improve MNG error handling to show error code. Fix code not expecting bitmap_get_buffer() to return 0.
svn path=/trunk/netsurf/; revision=4237
Diffstat (limited to 'riscos/save_draw.c')
-rw-r--r--riscos/save_draw.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/riscos/save_draw.c b/riscos/save_draw.c
index 8d1e812b0..5df1c0089 100644
--- a/riscos/save_draw.c
+++ b/riscos/save_draw.c
@@ -47,7 +47,7 @@ static bool ro_save_draw_path(float *p, unsigned int n, colour fill,
static bool ro_save_draw_fill(int x0, int y0, int x1, int y1, colour c);
static bool ro_save_draw_clip(int clip_x0, int clip_y0,
int clip_x1, int clip_y1);
-static bool ro_save_draw_text(int x, int y, struct css_style *style,
+static bool ro_save_draw_text(int x, int y, const struct css_style *style,
const char *text, size_t length, colour bg, colour c);
static bool ro_save_draw_disc(int x, int y, int radius, colour colour,
bool filled);
@@ -346,7 +346,7 @@ bool ro_save_draw_clip(int clip_x0, int clip_y0,
}
-bool ro_save_draw_text(int x, int y, struct css_style *style,
+bool ro_save_draw_text(int x, int y, const struct css_style *style,
const char *text, size_t length, colour bg, colour c)
{
pencil_code code;
@@ -380,8 +380,13 @@ bool ro_save_draw_bitmap(int x, int y, int width, int height,
struct bitmap *bitmap, colour bg)
{
pencil_code code;
+ char *buffer;
- bitmap_get_buffer(bitmap);
+ buffer = bitmap_get_buffer(bitmap);
+ if (!buffer) {
+ warn_user("NoMemory", 0);
+ return false;
+ }
code = pencil_sprite(ro_save_draw_diagram, x * 2, (-y - height) * 2,
width * 2, height * 2,