com php-src: Fix #53640: XBM images require width to be multiple of 8: NEWS ext/gd/libgd/xbm.c ext/gd/tests/bug53640.phpt

From: Date: Fri, 17 Jun 2016 15:50:36 +0000
Subject: com php-src: Fix #53640: XBM images require width to be multiple of 8: NEWS ext/gd/libgd/xbm.c ext/gd/tests/bug53640.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-92424@lists.php.net to get a copy of this message
Commit: ed0ec669968420ad0fa942c92d92b69a95e9beb1 Author: Christoph M. Becker <cmb@php.net> Fri, 17 Jun 2016 17:50:36 +0200 Parents: 0c34f53c93d65ef4741a9c6493f84a13ab68cb72 Branches: PHP-5.6 PHP-7.0 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ed0ec669968420ad0fa942c92d92b69a95e9beb1 Log: Fix #53640: XBM images require width to be multiple of 8 Bugs: https://bugs.php.net/53640 Changed paths: M NEWS M ext/gd/libgd/xbm.c M ext/gd/tests/bug53640.phpt Diff: diff --git a/NEWS b/NEWS index f28cb05..c7df8a0 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ PHP NEWS - GD: . Fixed bug #43475 (Thick styled lines have scrambled patterns).. (cmb) + . Fixed bug #53640 (XBM images require width to be multiple of 8). (cmb) - OpenSSL: . Fixed bug #71915 (openssl_random_pseudo_bytes is not fork-safe). diff --git a/ext/gd/libgd/xbm.c b/ext/gd/libgd/xbm.c index ce6b4c8..503ac82 100644 --- a/ext/gd/libgd/xbm.c +++ b/ext/gd/libgd/xbm.c @@ -210,7 +210,7 @@ void gdImageXbmCtx(gdImagePtr image, char* file_name, int fg, gdIOCtx * out) if (gdImageGetPixel(image, x, y) == fg) { c |= b; } - if ((b == 128) || (x == sx && y == sy)) { + if ((b == 128) || (x == sx - 1)) { b = 1; if (p) { gdCtxPrintf(out, ", "); diff --git a/ext/gd/tests/bug53640.phpt b/ext/gd/tests/bug53640.phpt index a16b7c2..ee875de 100644 --- a/ext/gd/tests/bug53640.phpt +++ b/ext/gd/tests/bug53640.phpt @@ -12,8 +12,6 @@ $white = imagecolorallocate($im, 255, 255, 255); imagefilledrectangle($im, 2, 2, 6, 6, $white); imagexbm($im, NULL); ?> ---XFAIL-- -Padding is not implemented yet --EXPECT-- #define image_width 9 #define image_height 9

« previous php.cvs (#92424) next »