From 6b526bb1c05d120200de2d9a7d9059e37eeca784 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Tue, 20 Feb 2018 05:03:00 +0900 Subject: [PATCH] Assert image page dimension in OptimizeLayerFrames (#990) OptimizeLayerFrames initializes the background with some assumptions for image page dimension. --- MagickCore/layer.c | 9 +++++---- config/english.xml | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/MagickCore/layer.c b/MagickCore/layer.c index c74424311..2fb707f12 100644 --- a/MagickCore/layer.c +++ b/MagickCore/layer.c @@ -962,10 +962,11 @@ static Image *OptimizeLayerFrames(const Image *image, { if ((curr->columns != image->columns) || (curr->rows != image->rows)) ThrowImageException(OptionError,"ImagesAreNotTheSameSize"); - /* - FUTURE: also check that image is also fully coalesced (full page) - Though as long as they are the same size it should not matter. - */ + + if ((curr->page.x != 0) || (curr->page.y != 0) || + (curr->page.width != image->page.width) || + (curr->page.height != image->page.height)) + ThrowImageException(OptionError,"ImagePagesAreNotCoalesced"); } /* Allocate memory (times 2 if we allow the use of frame duplications) diff --git a/config/english.xml b/config/english.xml index 535691254..69e6ddb44 100644 --- a/config/english.xml +++ b/config/english.xml @@ -652,6 +652,9 @@ images are not the same size + + image pages are not coalesced + size must exceed bevel width -- 2.40.0