From: Arnar Mar Hrafnkelsson Date: Wed, 31 Oct 2001 18:12:54 +0000 (+0000) Subject: changed malloc to mymalloc in error.c and Added reading from scalars for all X-Git-Tag: Imager-0.48^2~505 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/a6c47345e86b541cf380919eedd22c0747b93b4f changed malloc to mymalloc in error.c and Added reading from scalars for all formats that support iolayer. --- diff --git a/Imager.pm b/Imager.pm index 704c3ebb..ec35857b 100644 --- a/Imager.pm +++ b/Imager.pm @@ -855,7 +855,7 @@ sub read { if ($iolready{$input{'type'}}) { # Setup data source - $IO = io_new_fd($fd); # sort of simple for now eh? + $IO = defined $fd ? io_new_fd($fd) : io_new_buffer($input{data}); if ( $input{'type'} eq 'jpeg' ) { ($self->{IMG},$self->{IPTCRAW})=i_readjpeg_wiol( $IO ); diff --git a/error.c b/error.c index 4e6c0622..dd6b94f3 100644 --- a/error.c +++ b/error.c @@ -297,7 +297,7 @@ int i_failed(int code, char const *msg) { for (sp = error_sp; error_stack[sp].msg; ++sp) { total += strlen(error_stack[sp].msg) + 2; } - full = malloc(total); + full = mymalloc(total); if (!full) { /* just quit, at least it's on stderr */ exit(EXIT_FAILURE);