mirror of
https://github.com/php/php-src.git
synced 2024-11-25 19:05:31 +08:00
Bug fix: Images would be broken on big-endian machines because the putc
function wrote the first (instead of "the low order") byte. That resulted in unexpected zero bytes.
This commit is contained in:
parent
381d4e4ffa
commit
01c6257c5c
@ -24,8 +24,13 @@
|
||||
|
||||
static void _php_image_output_putc(struct gdIOCtx *ctx, int c)
|
||||
{
|
||||
/* without the following downcast, the write will fail
|
||||
* (i.e., will write a zero byte) for all
|
||||
* big endian architectures:
|
||||
*/
|
||||
unsigned char ch = (unsigned char) c;
|
||||
TSRMLS_FETCH();
|
||||
php_write(&c, 1 TSRMLS_CC);
|
||||
php_write(&ch, 1 TSRMLS_CC);
|
||||
}
|
||||
|
||||
static int _php_image_output_putbuf(struct gdIOCtx *ctx, const void* buf, int l)
|
||||
|
Loading…
Reference in New Issue
Block a user