]> git.imager.perl.org - imager.git/commitdiff
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 704c3ebbfe21b66dca8d89ae6ed607e654b57737..ec35857b8bf2f8f4bfc421013081d312246479e2 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 4e6c0622a89af44af2da126f5d1e435730fd58a1..dd6b94f324b38c5a01d611925da43b04204cd8c4 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);