diff --git a/NEWS b/NEWS index 29d1a22a4ea..eb88651544e 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,9 @@ PHP NEWS - FFI: . Fixed bug #79571 (FFI: var_dumping unions may segfault). (cmb) +- GD: + . Fixed bug #79615 (Wrong GIF header written in GD GIFEncode). (sageptr, cmb) + - Opcache: . Fixed bug #79588 (Boolean opcache settings ignore on/off values). (cmb) . Fixed bug #79548 (Preloading segfault with inherited method using static diff --git a/ext/gd/libgd/gd_gif_out.c b/ext/gd/libgd/gd_gif_out.c index 912769128ba..e721992b48c 100644 --- a/ext/gd/libgd/gd_gif_out.c +++ b/ext/gd/libgd/gd_gif_out.c @@ -333,7 +333,7 @@ GIFEncode(gdIOCtxPtr fp, int GWidth, int GHeight, int GInterlace, int Background /* * OR in the resolution */ - B |= (Resolution - 1) << 5; + B |= (Resolution - 1) << 4; /* * OR in the Bits per Pixel diff --git a/ext/gd/tests/bug79615.phpt b/ext/gd/tests/bug79615.phpt new file mode 100644 index 00000000000..b7cf9175c56 --- /dev/null +++ b/ext/gd/tests/bug79615.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #79615 (Wrong GIF header written in GD GIFEncode) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +10110011