From 79db70a3524bdcf20a0e9480e56638aa8252eccf Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Mon, 15 Jul 2019 08:03:51 +0200 Subject: [PATCH] Use DiscardBlobBytes instead. --- coders/tim2.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/coders/tim2.c b/coders/tim2.c index 8a7fb0e74..90d80b369 100644 --- a/coders/tim2.c +++ b/coders/tim2.c @@ -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: -- 2.40.0