mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-24 04:56:50 +03:00
[project @ 2006-01-24 23:05:56 by rjw]
Handle memory failure better. svn path=/import/netsurf/; revision=2030
This commit is contained in:
parent
ef1f971a9a
commit
ab9856c52a
@ -67,7 +67,7 @@ bool nsjpeg_convert(struct content *c, int w, int h)
|
||||
unsigned int height;
|
||||
unsigned int width;
|
||||
struct bitmap *bitmap = NULL;
|
||||
char *pixels;
|
||||
char *pixels = NULL;
|
||||
size_t rowstride;
|
||||
union content_msg_data msg_data;
|
||||
|
||||
@ -95,8 +95,12 @@ bool nsjpeg_convert(struct content *c, int w, int h)
|
||||
height = cinfo.output_height;
|
||||
|
||||
bitmap = bitmap_create(width, height, false);
|
||||
if (!bitmap) {
|
||||
if (bitmap)
|
||||
pixels = bitmap_get_buffer(bitmap);
|
||||
if ((!bitmap) || (!pixels)) {
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
if (bitmap)
|
||||
bitmap_destroy(bitmap);
|
||||
|
||||
msg_data.error = messages_get("NoMemory");
|
||||
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
|
||||
@ -105,7 +109,6 @@ bool nsjpeg_convert(struct content *c, int w, int h)
|
||||
}
|
||||
bitmap_set_opaque(bitmap, true);
|
||||
|
||||
pixels = bitmap_get_buffer(bitmap);
|
||||
rowstride = bitmap_get_rowstride(bitmap);
|
||||
do {
|
||||
JSAMPROW scanlines[1];
|
||||
|
Loading…
Reference in New Issue
Block a user