mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
fixed Fix #66590, which may segfault
This commit is contained in:
parent
9e08c990ac
commit
d3958b32ca
2 changed files with 18 additions and 0 deletions
|
@ -789,6 +789,7 @@ WebPResult WebPEncode(const uint8* Y,
|
|||
return webp_failure;
|
||||
}
|
||||
p[new_size - 1] = 0;
|
||||
*p_out = p;
|
||||
*p_out_size_bytes = new_size;
|
||||
}
|
||||
|
||||
|
|
17
ext/gd/tests/bug66590_1.phpt
Normal file
17
ext/gd/tests/bug66590_1.phpt
Normal file
|
@ -0,0 +1,17 @@
|
|||
--TEST--
|
||||
Bug #66590 (imagewebp() doesn't pad to even length) - segfault
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!function_exists('imagewebp')) die('skip WebP support not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$im = imagecreatetruecolor(6, 6);
|
||||
ob_start();
|
||||
imagewebp($im);
|
||||
ob_end_clean();
|
||||
echo "ready\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
ready
|
Loading…
Add table
Add a link
Reference in a new issue