]> granicus.if.org Git - imagemagick/commit
Fix previous image references in OptimizeImageLayers (#983)
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Tue, 13 Feb 2018 14:57:07 +0000 (23:57 +0900)
committerImageMagick <urban-warrior@users.noreply.github.com>
Tue, 13 Feb 2018 14:57:07 +0000 (09:57 -0500)
commit79e2db21148e6aeb2aef5218728d70ca577d6a57
treef196cd303e40b380b62e84f0fa9a7ff40eca7a42
parent5960b92b652b51cc53852e7ba3c9b65abceb0452
Fix previous image references in OptimizeImageLayers (#983)

The code used CloneImage with columns and rows arguments to create
previous image references.

However, the documentation of CloneImage says:
> If the specified columns and rows is 0, an exact copy of the image is
> returned, otherwise the pixel data is undefined and must be initialized
> with the QueueAuthenticPixels() and SyncAuthenticPixels() methods.  On
> failure, a NULL image is returned and exception describes the reason for the
> failure.

Therfore, the pixel data given by such a statement was undefined, which is
not expected.

This alters those arguments to 0, or replaces CloneImage with
ReferenceImage if it is enough.
MagickCore/layer.c