ImageMagick-7.0.9-5差分
ImageMagick-7.0.9-5差分
The latest release of ImageMagick is version 7.0.9-5
6 系同時リリースは ImageMagick-6.9.10-74
まとめ
- Ascii85 compression がスレッドセーフになった。(今まで危険だった)
気になる事
- コアな処理のポインタ型に magick_restrict 修飾(C の restrict)をつけまくってる。
- PNG と WebP でサイズチェック強化
差分
- Ascii85 compression がスレッドセーフだと保証する。
- Github に投稿された沢山の問題を修正
ソースコード
- MagickCore/compress.c
- - Ascii85 compression がスレッドセーフだと保証する。(関数内 static char を使い回してたのがまずい。Ascii85Info 構造体を使うようにした)
74a75,77 > char > tuple[6]; > 91,95c94,98 < #define TWId 23 < #define MWId 24 < #define TBId 25 < #define MBId 26 < #define EXId 27 --- > #define TWId 23L > #define MWId 24L > #define TBId 25L > #define MBId 26L > #define EXId 27L 228c231 < #define MaxLineExtent 36 --- > #define MaxLineExtent 36L 230c233,234 < static char *Ascii85Tuple(unsigned char *data) --- > static inline void Ascii85Tuple(Ascii85Info *ascii85_info, > const unsigned char *magick_restrict data) 232,234d235 < static char < tuple[6]; < 247,249c248,250 < tuple[0]='z'; < tuple[1]='\0'; < return(tuple); --- > ascii85_info->tuple[0]='z'; > ascii85_info->tuple[1]='\0'; > return; 256c257 < tuple[i]=(char) (x+(int) '!'); --- > ascii85_info->tuple[i]=(char) (x+(int) '!'); 259,261c260,261 < tuple[4]=(char) ((code % 85L)+(int) '!'); < tuple[5]='\0'; < return(tuple); --- > ascii85_info->tuple[4]=(char) ((code % 85L)+(int) '!'); > ascii85_info->tuple[5]='\0'; 274c274 < image->ascii85->line_break=(ssize_t) MaxLineExtent << 1; --- > image->ascii85->line_break=(ssize_t) (MaxLineExtent << 1); 280,282d279 < register char < *tuple; < 293c290 < tuple=Ascii85Tuple(image->ascii85->buffer); --- > Ascii85Tuple(image->ascii85,image->ascii85->buffer); 295c292,293 < (const unsigned char *) (*tuple == 'z' ? "!!!!" : tuple)); --- > (const unsigned char *) (*image->ascii85->tuple == 'z' ? "!!!!" : > image->ascii85->tuple)); 323c321,322 < for (q=Ascii85Tuple(p); *q != '\0'; q++) --- > Ascii85Tuple(image->ascii85,p); > for (q=image->ascii85->tuple; *q != '\0'; q++) 369,373c368,372 < #define HashSize 1021 < #define MBHashA 293 < #define MBHashB 2695 < #define MWHashA 3510 < #define MWHashB 1178 --- > #define HashSize 1021L > #define MBHashA 293L > #define MBHashB 2695L > #define MWHashA 3510L > #define MWHashB 1178L
- coders/png.c
6839c6839,6840 < if (mng_info->magn_methx || mng_info->magn_methy) --- > if (((mng_info->magn_methx > 0) && (mng_info->magn_methx <= 5)) && > ((mng_info->magn_methy > 0) && (mng_info->magn_methy <= 5)))
- coders/webp.c
194c194 < while ((offset+TAG_SIZE+4) <= (length-TAG_SIZE)) --- > while (offset <= (length-TAG_SIZE-TAG_SIZE-4))
あとは magick_restrict 追加がいっぱい。
ChangeLog
2019-11-17 7.0.9-5 Cristy <quetzlzacatenango@image...> * Release ImageMagick version 7.0.9-5, GIT revision 16369:747618e:20191117. 2019-11-16 7.0.9-5 Cristy <quetzlzacatenango@image...> * Ensure Ascii85 compression is thread safe. * Fixed numerous issues posted to GitHub (reference https://github.com/ImageMagick/ImageMagick/issues).