segv on bad SetPixel
Posted: 2011-01-25T13:47:12-07:00
With recent debian i386 packaged perlmagick 6.6.0.4, I passed (in ignorance) a string instead of an arrayref for a SetPixel color, per below, and got a segv (in av_len if gdb is to be believed). It'd be good if SetPixel threw an error of some sort if not given an arrayref there.
Code: Select all
use strict;
use warnings;
use Image::Magick;
my $m = Image::Magick->new (size => '20x10');
if (!$m) { die; }
my $err = $m->ReadImage('xc:black');
if ($err) { die $err; }
$err = $m->SetPixel (x=>3, y=>4, color=>'#AABBCC');
if ($err) { die $err; }
exit 0;