From: Cristy <urban-warrior@imagemagick.org>
Date: Sat, 9 Apr 2022 08:40:54 -0400
Subject: Fix CVE-2022-32547: unaligned access in property

bug: https://github.com/ImageMagick/ImageMagick/pull/5034
bug-debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1016442
origin: https://github.com/ImageMagick/ImageMagick6/commit/dc070da861a015d3c97488fdcca6063b44d47a7b.patch
bug-redhat: https://bugzilla.redhat.com/show_bug.cgi?id=2091813
---
 magick/property.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/magick/property.c b/magick/property.c
index 0381b4a..f839545 100644
--- a/magick/property.c
+++ b/magick/property.c
@@ -1513,12 +1513,14 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
             }
             case EXIF_FMT_SINGLE:
             {
-              EXIFMultipleValues(4,"%f",(double) *(float *) p1);
+              EXIFMultipleValues(4,"%.20g",(double)
+                ReadPropertySignedLong(endian,p1));
               break;
             }
             case EXIF_FMT_DOUBLE:
             {
-              EXIFMultipleValues(8,"%f",*(double *) p1);
+              EXIFMultipleValues(8,"%.20g",(double)
+                ReadPropertySignedLong(endian,p1));
               break;
             }
             case EXIF_FMT_STRING:
