diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2020-04-10 03:40:48 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2020-04-10 03:40:48 +0000 |
commit | 503c0227622254c0ae3209a1fa72bcb68bb450bc (patch) | |
tree | 48df20533f300f819504c15af33cdc03fc386a93 /Build/source/libs/gd/libgd-src/src/gd_xbm.c | |
parent | a9d86b73ecf95b83666e16c4d90e348c4958a63b (diff) |
libgd 2.3.0
git-svn-id: svn://tug.org/texlive/trunk@54636 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/gd/libgd-src/src/gd_xbm.c')
-rw-r--r-- | Build/source/libs/gd/libgd-src/src/gd_xbm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Build/source/libs/gd/libgd-src/src/gd_xbm.c b/Build/source/libs/gd/libgd-src/src/gd_xbm.c index 29bc5c2e8d5..cf0545efdb4 100644 --- a/Build/source/libs/gd/libgd-src/src/gd_xbm.c +++ b/Build/source/libs/gd/libgd-src/src/gd_xbm.c @@ -169,7 +169,11 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromXbm(FILE * fd) } h[3] = ch; } - sscanf(h, "%x", &b); + if (sscanf(h, "%x", &b) != 1) { + gd_error("invalid XBM"); + gdImageDestroy(im); + return 0; + } for (bit = 1; bit <= max_bit; bit = bit << 1) { gdImageSetPixel(im, x++, y, (b & bit) ? 1 : 0); if (x == im->sx) { @@ -220,7 +224,7 @@ static void gdCtxPrintf(gdIOCtx * out, const char *format, ...) * gd - Which color to use as forground color. All pixels with another * color are unset. * out - The <gdIOCtx> to write the image file to. - * + * */ BGD_DECLARE(void) gdImageXbmCtx(gdImagePtr image, char* file_name, int fg, gdIOCtx * out) { |