changed malloc to mymalloc in error.c and Added reading from scalars for all
authorArnar Mar Hrafnkelsson <addi@cpan.org>
Wed, 31 Oct 2001 18:12:54 +0000 (18:12 +0000)
committerArnar Mar Hrafnkelsson <addi@cpan.org>
Wed, 31 Oct 2001 18:12:54 +0000 (18:12 +0000)
formats that support iolayer.

Imager.pm
error.c

index 704c3eb..ec35857 100644 (file)
--- 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 4e6c062..dd6b94f 100644 (file)
--- 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);