From: dirk Date: Tue, 27 Sep 2016 19:29:53 +0000 (+0200) Subject: Fixed decreasing the number of packets. X-Git-Tag: 7.0.3-2~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=885af0df9eb6b60710d54b26096036d482911b4a;p=imagemagick Fixed decreasing the number of packets. --- diff --git a/coders/sgi.c b/coders/sgi.c index 0ccd9c031..8262a6c77 100644 --- a/coders/sgi.c +++ b/coders/sgi.c @@ -205,12 +205,12 @@ static MagickBooleanType SGIDecode(const size_t bytes_per_pixel, } else { + if (number_packets-- == 0) + return(MagickFalse); pixel=(size_t) (*p++) << 8; pixel|=(*p++); for ( ; count != 0; count--) { - if (number_packets-- == 0) - return(MagickFalse); *q=(unsigned char) (pixel >> 8); *(q+1)=(unsigned char) pixel; q+=8;