From: Cristy Date: Wed, 26 Apr 2017 19:12:55 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/441 X-Git-Tag: 7.0.5-6~55 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48291e72d4d484e69acab1a6b7709c3e10cc525e;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/441 --- diff --git a/coders/exr.c b/coders/exr.c index 90baddb2c..43cb142b0 100644 --- a/coders/exr.c +++ b/coders/exr.c @@ -207,6 +207,7 @@ static Image *ReadEXRImage(const ImageInfo *image_info,ExceptionInfo *exception) if (LocaleCompare(image_info->filename,read_info->filename) != 0) (void) RelinquishUniqueFileResource(read_info->filename); read_info=DestroyImageInfo(read_info); + image=DestroyImageList(image); return((Image *) NULL); } hdr_info=ImfInputHeader(file); @@ -244,6 +245,7 @@ static Image *ReadEXRImage(const ImageInfo *image_info,ExceptionInfo *exception) if (LocaleCompare(image_info->filename,read_info->filename) != 0) (void) RelinquishUniqueFileResource(read_info->filename); read_info=DestroyImageInfo(read_info); + image=DestroyImageList(image); ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); } } @@ -258,14 +260,14 @@ static Image *ReadEXRImage(const ImageInfo *image_info,ExceptionInfo *exception) yy=display_window.min_y+y; if ((yy < data_window.min_y) || (yy > data_window.max_y) || (scanline == (ImfRgba *) NULL)) - { - for (x=0; x < (ssize_t) image->columns; x++) { - SetPixelViaPixelInfo(image,&image->background_color,q); - q+=GetPixelChannels(image); + for (x=0; x < (ssize_t) image->columns; x++) + { + SetPixelViaPixelInfo(image,&image->background_color,q); + q+=GetPixelChannels(image); + } + continue; } - continue; - } ResetMagickMemory(scanline,0,columns*sizeof(*scanline)); ImfInputSetFrameBuffer(file,scanline-data_window.min_x-columns*yy,1, columns);