]> granicus.if.org Git - imagemagick/commitdiff
Use DiscardBlobBytes instead.
authorDirk Lemstra <dirk@lemstra.org>
Mon, 15 Jul 2019 06:03:51 +0000 (08:03 +0200)
committerDirk Lemstra <dirk@lemstra.org>
Mon, 15 Jul 2019 06:04:33 +0000 (08:04 +0200)
coders/tim2.c

index 8a7fb0e7498f7db1d4c84b25a5f41a598e5b2655..90d80b36974e5d30e3c269772666fe64b9052e65 100644 (file)
@@ -233,17 +233,6 @@ static inline void deshufflePalette(Image *image,PixelInfo* oldColormap)
   }
 }
 
-static MagickBooleanType SkipTIM2Bytes(Image *image,size_t count)
-{
-  while (count > 0)
-  {
-    if (ReadBlobByte(image) == EOF)
-      return(MagickFalse);
-    count--;
-  }
-  return(MagickTrue);
-}
-
 static MagickBooleanType ReadTIM2ImageData(const ImageInfo *image_info,
   Image *image,TIM2ImageHeader *header,char clut_depth,char bits_per_pixel,
   ExceptionInfo *exception)
@@ -280,7 +269,7 @@ static MagickBooleanType ReadTIM2ImageData(const ImageInfo *image_info,
   /*
    * User data
    */
-  status=SkipTIM2Bytes(image,header->header_size-48);
+  status=DiscardBlobBytes(image,header->header_size-48);
   if (status == MagickFalse)
     return(MagickFalse);
   /*
@@ -682,11 +671,11 @@ static Image *ReadTIM2Image(const ImageInfo *image_info,ExceptionInfo *exception
   switch(file_header.format_type)
   {
     case 0x00:
-      if (SkipTIM2Bytes(image,16) == MagickFalse)
+      if (DiscardBlobBytes(image,16) == MagickFalse)
         ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
       break;
     case 0x01:
-      if (SkipTIM2Bytes(image,128) == MagickFalse)
+      if (DiscardBlobBytes(image,128) == MagickFalse)
         ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
       break;
     default: