summaryrefslogtreecommitdiff
path: root/ext/gd/libgd/gd_gif_out.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-05-22 09:11:28 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-05-22 09:15:41 +0200
commitd4bd6fb491ccaf70006d6f671755126b47a71bcb (patch)
treeddf3950ecdc0e71d4d9b0e4f2d892420ee7a6a31 /ext/gd/libgd/gd_gif_out.c
parent85ac5643ff07e07e40df89510726e1bc66e6a50b (diff)
downloadphp-git-d4bd6fb491ccaf70006d6f671755126b47a71bcb.tar.gz
Fix #79615: Wrong GIF header written in GD GIFEncode
The color resolution is expected in bits 4-6 of the packed fields byte of the logical screen descriptor (byte 10 of the GIF data stream), according to the specification[1], section 18. [1] <https://www.w3.org/Graphics/GIF/spec-gif89a.txt>
Diffstat (limited to 'ext/gd/libgd/gd_gif_out.c')
-rw-r--r--ext/gd/libgd/gd_gif_out.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/gd/libgd/gd_gif_out.c b/ext/gd/libgd/gd_gif_out.c
index c0a0433f4d..771e8afe2e 100644
--- a/ext/gd/libgd/gd_gif_out.c
+++ b/ext/gd/libgd/gd_gif_out.c
@@ -319,7 +319,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