summaryrefslogtreecommitdiff
path: root/image
diff options
context:
space:
mode:
authorRichard Wilson <rjw@netsurf-browser.org>2005-02-02 02:05:58 +0000
committerRichard Wilson <rjw@netsurf-browser.org>2005-02-02 02:05:58 +0000
commit42ab950b138ef9f8f0c87b9dbc0d196bbf1c7cd2 (patch)
tree5a526197da1f4e7b7ea8ac132ed594188cf9ce81 /image
parent82e4286c5fc39e0f0138732f364667bd754894e0 (diff)
downloadnetsurf-42ab950b138ef9f8f0c87b9dbc0d196bbf1c7cd2.tar.gz
netsurf-42ab950b138ef9f8f0c87b9dbc0d196bbf1c7cd2.tar.bz2
[project @ 2005-02-02 02:05:58 by rjw]
Accomodate further GIF brokenness. svn path=/import/netsurf/; revision=1481
Diffstat (limited to 'image')
-rw-r--r--image/gifread.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/image/gifread.c b/image/gifread.c
index dd692d8dc..fc49bfcb7 100644
--- a/image/gifread.c
+++ b/image/gifread.c
@@ -169,7 +169,9 @@ int gif_initialise(struct gif_animation *gif) {
((gif->width == 800) && (gif->width == 600)) ||
((gif->width == 1024) && (gif->width == 768)) ||
((gif->width == 1280) && (gif->width == 1024)) ||
- ((gif->width == 1600) && (gif->width == 1200))) {
+ ((gif->width == 1600) && (gif->width == 1200)) ||
+ ((gif->width == 0) || (gif->height == 0)) ||
+ ((gif->width > 2048) || (gif->height > 2048))) {
gif->width = 1;
gif->height = 1;
}
@@ -278,11 +280,12 @@ static int gif_initialise_sprite(struct gif_animation *gif, unsigned int width,
/* Allocate some more memory
*/
- if ((buffer = bitmap_create(max_width, max_height)) == NULL) {
+ if ((buffer = bitmap_create(max_width, max_height)) == NULL)
return GIF_INSUFFICIENT_MEMORY;
- }
bitmap_destroy(gif->frame_image);
gif->frame_image = buffer;
+ gif->width = max_width;
+ gif->height = max_height;
/* Invalidate our currently decoded image
*/