From a07ecde4c1c3a3efaa628434adc903295f6bb2b3 Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Mon, 14 Oct 2019 19:41:20 -0400
Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/1753

---
 coders/pdf.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/coders/pdf.c b/coders/pdf.c
index 4da13db33..dd1a504e5 100644
--- a/coders/pdf.c
+++ b/coders/pdf.c
@@ -1991,7 +1991,7 @@ RestoreMSCWarning
                   break;
                 indexes=GetVirtualIndexQueue(image);
                 for (x=0; x < (ssize_t) image->columns; x++)
-                  *q++=(unsigned char) GetPixelIndex(indexes+x);
+                  *q++=(unsigned char) ((ssize_t) GetPixelIndex(indexes+x));
                 if (image->previous == (Image *) NULL)
                   {
                     status=SetImageProgress(image,SaveImageTag,
@@ -2033,7 +2033,7 @@ RestoreMSCWarning
                 indexes=GetVirtualIndexQueue(image);
                 for (x=0; x < (ssize_t) image->columns; x++)
                   Ascii85Encode(image,(unsigned char)
-                    GetPixelIndex(indexes+x));
+                    ((ssize_t) GetPixelIndex(indexes+x)));
                 if (image->previous == (Image *) NULL)
                   {
                     status=SetImageProgress(image,SaveImageTag,
@@ -2491,7 +2491,7 @@ RestoreMSCWarning
                   break;
                 indexes=GetVirtualIndexQueue(tile_image);
                 for (x=0; x < (ssize_t) tile_image->columns; x++)
-                  *q++=(unsigned char) GetPixelIndex(indexes+x);
+                  *q++=(unsigned char) ((ssize_t) GetPixelIndex(indexes+x));
               }
 #if defined(MAGICKCORE_ZLIB_DELEGATE)
               if (compression == ZipCompression)
@@ -2525,7 +2525,8 @@ RestoreMSCWarning
                   break;
                 indexes=GetVirtualIndexQueue(tile_image);
                 for (x=0; x < (ssize_t) tile_image->columns; x++)
-                  Ascii85Encode(image,(unsigned char) GetPixelIndex(indexes+x));
+                  Ascii85Encode(image,(unsigned char)
+                    ((ssize_t) GetPixelIndex(indexes+x)));
               }
               Ascii85Flush(image);
               break;
