]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Sun, 9 Jul 2017 18:36:16 +0000 (14:36 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 9 Jul 2017 18:36:16 +0000 (14:36 -0400)
coders/mat.c
coders/rle.c

index 388139caefa54ca7f92af050bd1ec4b69aa87f28..240cedf79d6f3dbf26c0e67c76efa0ac9e271b95 100644 (file)
@@ -948,7 +948,7 @@ MATLAB_KO:
     if(EOFBlob(image)) break;
     MATLAB_HDR.ObjectSize = ReadBlobXXXLong(image);
     if(EOFBlob(image)) break;
-    if(MATLAB_HDR.ObjectSize+filepos > GetBlobSize(image))
+    if((MagickSizeType) (MATLAB_HDR.ObjectSize+filepos) > GetBlobSize(image))
       goto MATLAB_KO;
     filepos += MATLAB_HDR.ObjectSize + 4 + 4;
 
index 93ad52180944fa150a79b6c368ff34c00037d5bb..d295116a1d47525bc92a3ee215099fd03a0a92cc 100644 (file)
@@ -432,7 +432,7 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception)
             number_planes+plane);
           operand++;
           if ((offset < 0) ||
-              ((offset+operand*number_planes) > (ssize_t) pixel_info_length))
+              ((size_t) (offset+operand*number_planes) > pixel_info_length))
             {
               if (number_colormaps != 0)
                 colormap=(unsigned char *) RelinquishMagickMemory(colormap);
@@ -470,7 +470,7 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception)
             number_planes+plane);
           operand++;
           if ((offset < 0) ||
-              ((offset+operand*number_planes) > (ssize_t) pixel_info_length))
+              ((size_t) (offset+operand*number_planes) > pixel_info_length))
             {
               if (number_colormaps != 0)
                 colormap=(unsigned char *) RelinquishMagickMemory(colormap);