mirror of
https://github.com/Imagick/imagick.git
synced 2026-06-19 07:35:36 +00:00
Correct memory stomping in Imagick::colorDecisionListImage
This commit is contained in:
+1
-1
@@ -12724,7 +12724,7 @@ PHP_METHOD(imagick, colordecisionlistimage)
|
||||
MagickBooleanType status;
|
||||
|
||||
char *color_correction_collection;
|
||||
int ccc_len;
|
||||
IM_LEN_TYPE ccc_len;
|
||||
|
||||
/* Parse parameters given to function */
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &color_correction_collection, &ccc_len) == FAILURE) {
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
--TEST--
|
||||
Test artifacts
|
||||
Test Imagick::setImageArtifact and Imagick::getImageArtifact
|
||||
--SKIPIF--
|
||||
<?php
|
||||
|
||||
$imageMagickRequiredVersion = 0x656;
|
||||
|
||||
require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
checkClassMethods('Imagick', array('setImageArtifact', 'getImageArtifact', 'deleteImageArtifact'));
|
||||
|
||||
$v = Imagick::getVersion();
|
||||
/* See imagick_class.c */
|
||||
if ($v['versionNumber'] <= 0x656) {
|
||||
die ('skip too old ImageMagick');
|
||||
}
|
||||
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
Test Imagick::colorDecisionListImage
|
||||
--SKIPIF--
|
||||
<?php
|
||||
|
||||
$imageMagickRequiredVersion = 0x676;
|
||||
|
||||
require_once(dirname(__FILE__) . '/skipif.inc');
|
||||
checkClassMethods('Imagick', array('colorDecisionListImage'));
|
||||
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$im = new Imagick("magick:logo");
|
||||
|
||||
$ccc = <<< CCC
|
||||
<ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
|
||||
<ColorCorrection id="cc03345">
|
||||
<SOPNode>
|
||||
<Slope> 0.9 1.2 0.5 </Slope>
|
||||
<Offset> 0.4 -0.5 0.6 </Offset>
|
||||
<Power> 1.0 0.8 1.5 </Power>
|
||||
</SOPNode>
|
||||
<SATNode>
|
||||
<Saturation> 0.85 </Saturation>
|
||||
</SATNode>
|
||||
</ColorCorrection>
|
||||
</ColorCorrectionCollection>
|
||||
CCC;
|
||||
|
||||
$im->colorDecisionListImage($ccc);
|
||||
|
||||
echo "Ok"
|
||||
?>
|
||||
--EXPECT--
|
||||
Ok
|
||||
Reference in New Issue
Block a user