summaryrefslogtreecommitdiffstats
path: root/upstream.patch
blob: db5678e082c776da21459e7680e54708b0a1248a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From bcbfef937b6cb25b8b9fbf9bbf94dfabb3826822 Mon Sep 17 00:00:00 2001
From: Andrey Semashev <Lastique@users.noreply.github.com>
Date: Thu, 29 Apr 2021 04:58:49 +0300
Subject: [PATCH] Fix incorrect client_data pointer being set in libjpeg
 context. (#152)

This fixes incorrect data processing in libjpeg callbacks.

Fixes https://github.com/ImageMagick/ImageMagick6/issues/150
Fixes https://github.com/ImageMagick/ImageMagick6/issues/151
---
 coders/jpeg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/coders/jpeg.c b/coders/jpeg.c
index ec1aceff0..c266b5975 100644
--- a/coders/jpeg.c
+++ b/coders/jpeg.c
@@ -1199,7 +1199,7 @@ static Image *ReadJPEGImage_(const ImageInfo *image_info,
       InheritException(exception,&image->exception);
       return(DestroyImage(image));
     }
-  jpeg_info->client_data=(void *) &client_info;
+  jpeg_info->client_data=(void *) client_info;
   jpeg_create_decompress(jpeg_info);
   if (GetMaxMemoryRequest() != ~0UL)
     jpeg_info->mem->max_memory_to_use=(long) GetMaxMemoryRequest();
@@ -2361,7 +2361,7 @@ static MagickBooleanType WriteJPEGImage_(const ImageInfo *image_info,
       (void) CloseBlob(volatile_image);
       return(MagickFalse);
     }
-  jpeg_info->client_data=(void *) &client_info;
+  jpeg_info->client_data=(void *) client_info;
   jpeg_create_compress(jpeg_info);
   JPEGDestinationManager(jpeg_info,image);
   if ((image->columns != (unsigned int) image->columns) ||