Skip to content

Commit 10a94f8

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
2 parents 38501ed + b456ae8 commit 10a94f8

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

NEWS

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ PHP NEWS
2020

2121
- Gd:
2222
. ext/gd/tests/gh10614.phpt: skip if no PNG support. (orlitzky)
23+
. restored warning instead of fata error. (dryabov)
2324

2425
- LibXML:
2526
. Fixed bug GH-14563 (Build failure with libxml2 v2.13.0). (nielsdos)

ext/gd/libgd/gd_webp.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <string.h>
44
#include <stdlib.h>
55
#include "gd.h"
6+
#include "gd_errors.h"
67
#include "gdhelpers.h"
78

89
#ifdef HAVE_LIBWEBP
@@ -56,7 +57,7 @@ gdImagePtr gdImageCreateFromWebpCtx (gdIOCtx * infile)
5657
if (filedata) {
5758
gdFree(filedata);
5859
}
59-
zend_error(E_ERROR, "WebP decode: realloc failed");
60+
gd_error("WebP decode: realloc failed");
6061
return NULL;
6162
}
6263

@@ -67,7 +68,7 @@ gdImagePtr gdImageCreateFromWebpCtx (gdIOCtx * infile)
6768
} while (n>0 && n!=EOF);
6869

6970
if (WebPGetInfo(filedata,size, &width, &height) == 0) {
70-
zend_error(E_ERROR, "gd-webp cannot get webp info");
71+
gd_error("gd-webp cannot get webp info");
7172
gdFree(filedata);
7273
return NULL;
7374
}
@@ -79,7 +80,7 @@ gdImagePtr gdImageCreateFromWebpCtx (gdIOCtx * infile)
7980
}
8081
argb = WebPDecodeARGB(filedata, size, &width, &height);
8182
if (!argb) {
82-
zend_error(E_ERROR, "gd-webp cannot allocate temporary buffer");
83+
gd_error("gd-webp cannot allocate temporary buffer");
8384
gdFree(filedata);
8485
gdImageDestroy(im);
8586
return NULL;
@@ -113,7 +114,7 @@ void gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quality)
113114
}
114115

115116
if (!gdImageTrueColor(im)) {
116-
zend_error(E_ERROR, "Palette image not supported by webp");
117+
gd_error("Palette image not supported by webp");
117118
return;
118119
}
119120

@@ -159,7 +160,7 @@ void gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quality)
159160
}
160161

161162
if (out_size == 0) {
162-
zend_error(E_ERROR, "gd-webp encoding failed");
163+
gd_error("gd-webp encoding failed");
163164
goto freeargb;
164165
}
165166
gdPutBuf(out, out_size, outfile);

0 commit comments

Comments
 (0)