diff options
author | Pierre Joye <pierre.php@gmail.com> | 2021-09-10 04:57:22 +0700 |
---|---|---|
committer | Pierre Joye <pierre.php@gmail.com> | 2021-09-10 04:57:22 +0700 |
commit | 02f5a7ae056fa80b031b7c66d8df5a034c987950 (patch) | |
tree | 1f2a3959645819ddab1fec65c2cbc38aa37a643c | |
parent | 8074c820468176e2ea27cbf0192a8aee3660a7df (diff) | |
parent | 6f5136821be86e7068fcdf651ae9420b5d42e9a9 (diff) | |
download | libgd-02f5a7ae056fa80b031b7c66d8df5a034c987950.tar.gz |
merge conflict
-rw-r--r-- | README.md | 18 | ||||
-rw-r--r-- | src/gd2topng.c | 2 | ||||
-rw-r--r-- | src/gd_bmp.c | 14 | ||||
-rw-r--r-- | src/gd_webp.c | 7 | ||||
-rw-r--r-- | tests/png/bug00338.c | 2 | ||||
-rw-r--r-- | tmp/preamble.txt | 0 |
6 files changed, 28 insertions, 15 deletions
@@ -64,15 +64,15 @@ CI means whether we have an automatic CI for this platform. If someone has CI fo | Platform | Support | CI | | ------------- | ------------- |----| -| Linux x64 | 🗸 | 🗸 | -| Linux x86 | 🗸 | 🗸 | -| Linux ARM64 | 🗸 | 🗸 | -| Windows x86 | 🗸 | 🗸 | -| Windows x64 | 🗸 | 🗸 | -| Windows arm64 | 🗸 | x | -| MacOS x64 | 🗸 | 🗸 | -| MacOS M1 | 🗸 | x | -| S390 | 🗸 | x | +| Linux x64 | ✓ | ✓ | +| Linux x86 | ✓ | ✓ | +| Linux ARM64 | ✓ | ✓ | +| Windows x86 | ✓ | ✓ | +| Windows x64 | ✓ | ✓ | +| Windows arm64 | ✓ | x | +| MacOS x64 | ✓ | ✓ | +| MacOS M1 | ✓ | x | +| S390 | ✓ | x | It is also known to work on almost all variations of *BSD, Solaris, etc. We don't have CI nor environment to test them. However many progamming languages binding do test libgd on these platforms. diff --git a/src/gd2topng.c b/src/gd2topng.c index 5e8ca87..d6c1359 100644 --- a/src/gd2topng.c +++ b/src/gd2topng.c @@ -21,7 +21,7 @@ main (int argc, char **argv) fprintf (stderr, "Usage: gd2topng filename.gd2 filename.png [srcx srcy width height]\n"); fprintf (stderr, - "If the coordinates are absent,t he entire image is converted.\n"); + "If the coordinates are absent, the entire image is converted.\n"); exit (1); } if (argc == 7) { diff --git a/src/gd_bmp.c b/src/gd_bmp.c index e186ac9..c67e45f 100644 --- a/src/gd_bmp.c +++ b/src/gd_bmp.c @@ -30,6 +30,7 @@ #include <stdlib.h> #include "gd.h" #include "gdhelpers.h" +#include "gd_errors.h" #include "bmp.h" static int compress_row(unsigned char *uncompressed_row, int length); @@ -266,7 +267,11 @@ static int _gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression) bitmap_size += compressed_size; - gdPutBuf(uncompressed_row, compressed_size, out); + if (gdPutBuf(uncompressed_row, compressed_size, out) != compressed_size){ + gd_error("gd-bmp write error\n"); + error = 1; + break; + } gdPutC(BMP_RLE_COMMAND, out); gdPutC(BMP_RLE_ENDOFLINE, out); bitmap_size += 2; @@ -325,7 +330,10 @@ static int _gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression) if (buffer_size == 0) { break; } - gdPutBuf(copy_buffer , buffer_size, out_original); + if (gdPutBuf(copy_buffer , buffer_size, out_original) != buffer_size) { + gd_error("gd-bmp write error\n"); + error = 1; + } } gdFree(copy_buffer); @@ -335,7 +343,7 @@ static int _gdImageBmpCtx(gdImagePtr im, gdIOCtxPtr out, int compression) out_original = NULL; } - ret = 0; + ret = error; cleanup: if (tmpfile_for_compression) { #ifdef _WIN32 diff --git a/src/gd_webp.c b/src/gd_webp.c index bf89087..e9ad802 100644 --- a/src/gd_webp.c +++ b/src/gd_webp.c @@ -227,8 +227,13 @@ static int _gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quality) ret = 1; goto freeargb; } - gdPutBuf(out, out_size, outfile); + + int res = gdPutBuf(out, out_size, outfile); free(out); + if (res != out_size) { + gd_error("gd-webp write error\n"); + ret = 1; + } freeargb: gdFree(argb); diff --git a/tests/png/bug00338.c b/tests/png/bug00338.c index 814a5ab..4fd5273 100644 --- a/tests/png/bug00338.c +++ b/tests/png/bug00338.c @@ -35,7 +35,7 @@ int main() im = gdImageCreateTrueColor(10, 10); fp = gdTestTempFp(); - gdTestAssert(fp!=NULL); + gdTestAssert(fp != NULL); if (!fp) { exit(2); } diff --git a/tmp/preamble.txt b/tmp/preamble.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tmp/preamble.txt |