From ff6c41f660a74b09d65fc3786ede2069dcbff018 Mon Sep 17 00:00:00 2001 From: glennrp Date: Mon, 31 Oct 2011 15:57:41 +0000 Subject: [PATCH] Ensure the GIF encoder writes a large enough logical screen. --- coders/gif.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/coders/gif.c b/coders/gif.c index a84bc13a8..7d87589de 100644 --- a/coders/gif.c +++ b/coders/gif.c @@ -1532,9 +1532,13 @@ static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image, Determine image bounding box. */ page.width=image->columns; + if (image->page.width > page.width) + page.width=image->page.width; page.height=image->rows; - page.x=0; - page.y=0; + if (image->page.height > page.height) + page.height=image->page.height; + page.x=image->page.x; + page.y=image->page.y; if (write_info->adjoin != MagickFalse) for (next_image=image; next_image != (Image *) NULL; ) { @@ -1546,12 +1550,9 @@ static MagickBooleanType WriteGIFImage(const ImageInfo *image_info,Image *image, page.height=next_image->page.height+page.y; next_image=GetNextImageInList(next_image); } - page.x=image->page.x; - page.y=image->page.y; - if ((image->page.width != 0) && (image->page.height != 0)) - page=image->page; (void) WriteBlobLSBShort(image,(unsigned short) page.width); (void) WriteBlobLSBShort(image,(unsigned short) page.height); + /* Write images to file. */ -- 2.50.1