Skip to content

Commit

Permalink
https://github.com/ImageMagick/ImageMagick/issues/6775
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Oct 11, 2023
1 parent 3c72750 commit bd0fae8
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions coders/xbm.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,24 +187,23 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception)
MagickBooleanType
status;

ssize_t
i,
x;
MagickOffsetType
offset;

Quantum
*q;

unsigned char
*p;

short int
hex_digits[256];

ssize_t
i,
x,
y;

unsigned char
*data;
*data,
*p;

unsigned int
bit,
Expand Down Expand Up @@ -258,6 +257,7 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception)
Scan until hex digits.
*/
version=11;
offset=TellBlob(image);
while (ReadBlobString(image,buffer) != (char *) NULL)
{
if (sscanf(buffer,"static short %1024s = {",name) == 1)
Expand All @@ -277,7 +277,10 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception)
p++;
if (LocaleCompare("bits[]",(char *) p) == 0)
break;
offset=TellBlob(image);
}
if (strchr(buffer,'{') != (char *) NULL)
(void) SeekBlob(image,offset+(strchr(buffer,'{')-buffer)+1,SEEK_SET);
/*
Initialize image structure.
*/
Expand Down Expand Up @@ -444,6 +447,7 @@ ModuleExport size_t RegisterXBMImage(void)
entry->decoder=(DecodeImageHandler *) ReadXBMImage;
entry->encoder=(EncodeImageHandler *) WriteXBMImage;
entry->magick=(IsImageFormatHandler *) IsXBM;
entry->flags|=CoderDecoderSeekableStreamFlag;
entry->flags^=CoderAdjoinFlag;
(void) RegisterMagickInfo(entry);
return(MagickImageCoderSignature);
Expand Down

0 comments on commit bd0fae8

Please sign in to comment.