From ae1a58d6503db1d0e050ad87475f5839d042c251 Mon Sep 17 00:00:00 2001
From: cristy <cristy@aa41f4f7-0bf4-0310-aa73-e5a19afd5a74>
Date: Tue, 23 Dec 2014 01:25:22 +0000
Subject: [PATCH] During identification of image do not fill memory

This create a security risk (DOS) by filling all memory during identification of image.

git-svn-id: https://subversion.imagemagick.org/subversion/ImageMagick/branches/ImageMagick-6@17413 aa41f4f7-0bf4-0310-aa73-e5a19afd5a74
origin: http://trac.imagemagick.org/changeset/17413
---
 coders/tiff.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/coders/tiff.c b/coders/tiff.c
index 8d8f2c8..37051f2 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -1029,6 +1029,16 @@ static Image *ReadTIFFImage(const ImageInfo *image_info,
       case COMPRESSION_ADOBE_DEFLATE: image->compression=ZipCompression; break;
       default: image->compression=RLECompression; break;
     }
+    if (image_info->ping == MagickFalse)
+      TIFFGetProfiles(tiff,image);
+    TIFFGetProperties(tiff,image);
+    option=GetImageOption(image_info,"tiff:exif-properties");
+    if ((option == (const char *) NULL) ||
+        (IsMagickTrue(option) != MagickFalse))
+      TIFFGetEXIFProperties(tiff,image);
+    /*
+      Allocate memory for the image and pixel buffer.
+    */
     quantum_info=AcquireQuantumInfo(image_info,image);
     if (quantum_info == (QuantumInfo *) NULL)
       ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
-- 
2.1.4

