From: Cristy Date: Sat, 2 Sep 2017 19:03:01 +0000 (-0400) Subject: Improve initialization X-Git-Tag: 7.0.7-0~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a4de5630c83cd81417b05fa1f7d74eee013b0ec;p=imagemagick Improve initialization --- diff --git a/coders/xbm.c b/coders/xbm.c index ea2f76bf9..5fd9eca7c 100644 --- a/coders/xbm.c +++ b/coders/xbm.c @@ -234,6 +234,7 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception) */ width=0; height=0; + *name='\0'; while (ReadBlobString(image,buffer) != (char *) NULL) if (sscanf(buffer,"#define %32s %u",name,&width) == 2) if ((strlen(name) >= 6) && @@ -301,6 +302,8 @@ static Image *ReadXBMImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Initialize hex values. */ + for (i=0; i < sizeof(hex_digits)/sizeof(*hex_digits); i++) + hex_digits[i]=(-1); hex_digits[(int) '0']=0; hex_digits[(int) '1']=1; hex_digits[(int) '2']=2;