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 eb9ac36 commit 23187cd
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions coders/xbm.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,37 +177,37 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception)
Image
*image;

IndexPacket
*indexes;

int
c;


long
height,
width;

MagickBooleanType
status;

IndexPacket
*indexes;

ssize_t
i,
x;
MagickOffsetType
offset;

PixelPacket
*q;

unsigned char
*p;

long
height,
width;

short int
hex_digits[256];

ssize_t
i,
x,
y;

unsigned char
*data;
*data,
*p;

unsigned int
bit,
Expand Down Expand Up @@ -261,6 +261,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 @@ -280,7 +281,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 @@ -449,6 +453,7 @@ ModuleExport size_t RegisterXBMImage(void)
entry->decoder=(DecodeImageHandler *) ReadXBMImage;
entry->encoder=(EncodeImageHandler *) WriteXBMImage;
entry->magick=(IsImageFormatHandler *) IsXBM;
entry->seekable_stream=MagickTrue;
entry->adjoin=MagickFalse;
entry->description=ConstantString(
"X Windows system bitmap (black and white)");
Expand Down

0 comments on commit 23187cd

Please sign in to comment.