From: Dirk Lemstra Date: Mon, 15 Jul 2019 06:03:51 +0000 (+0200) Subject: Use DiscardBlobBytes instead. X-Git-Tag: 7.0.8-54~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=79db70a3524bdcf20a0e9480e56638aa8252eccf;p=imagemagick Use DiscardBlobBytes instead. --- 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: