]> git.imager.perl.org - imager.git/commitdiff
- some jpeg.c logging calls didn't include parameters enough to match
authorTony Cook <tony@develop=help.com>
Sun, 5 Mar 2006 13:54:59 +0000 (13:54 +0000)
committerTony Cook <tony@develop=help.com>
Sun, 5 Mar 2006 13:54:59 +0000 (13:54 +0000)
  the supplied format string.
- in some cases memory wasn't being freed during error handling when
  reading jpeg images

Changes
jpeg.c

diff --git a/Changes b/Changes
index a91ed5ccd63648ee6da012d1566e7548b7a4f364..7cd36e053aac0f3b3922ef5a3500e7edfd60aa80 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1381,6 +1381,10 @@ Revision history for Perl extension Imager.
 - tifflib 3.8.0 with MDI (Microsoft(tm) TIFF) support produces a 
   different error when it reads a file with a bad magic number.
   Update the test to handle the possible messages.
+- some jpeg.c logging calls didn't include parameters enough to match
+  the supplied format string.
+- in some cases memory wasn't being freed during error handling when
+  reading jpeg images
 
 =================================================================
 
diff --git a/jpeg.c b/jpeg.c
index 42535d5ac75dd24bd2c9ec37a1659d4269806e8f..141ac4ccdce793926b59f255642a40bb9dcf5314 100644 (file)
--- a/jpeg.c
+++ b/jpeg.c
@@ -101,7 +101,7 @@ wiol_fill_input_buffer(j_decompress_ptr cinfo) {
   wiol_src_ptr src = (wiol_src_ptr) cinfo->src;
   ssize_t nbytes; /* We assume that reads are "small" */
   
-  mm_log((1,"wiol_fill_input_buffer(cinfo 0x%p)\n"));
+  mm_log((1,"wiol_fill_input_buffer(cinfo 0x%p)\n", cinfo));
   
   nbytes = src->data->readcb(src->data, src->buffer, JPGS);
   
@@ -355,7 +355,7 @@ i_readjpeg_wiol(io_glue *data, int length, char** iptc_itext, int *itlength) {
   int row_stride;              /* physical row width in output buffer */
   jpeg_saved_marker_ptr markerp;
 
-  mm_log((1,"i_readjpeg_wiol(data 0x%p, length %d,iptc_itext 0x%p)\n", data, iptc_itext));
+  mm_log((1,"i_readjpeg_wiol(data 0x%p, length %d,iptc_itext 0x%p)\n", data, length, iptc_itext));
 
   i_clear_error();
 
@@ -383,12 +383,13 @@ i_readjpeg_wiol(io_glue *data, int length, char** iptc_itext, int *itlength) {
   if (!i_int_check_image_file_limits(cinfo.output_width, cinfo.output_height,
                                     cinfo.output_components, sizeof(i_sample_t))) {
     mm_log((1, "i_readjpeg: image size exceeds limits\n"));
-
+    wiol_term_source(&cinfo);
     jpeg_destroy_decompress(&cinfo);
     return NULL;
   }
   im=i_img_empty_ch(NULL,cinfo.output_width,cinfo.output_height,cinfo.output_components);
   if (!im) {
+    wiol_term_source(&cinfo);
     jpeg_destroy_decompress(&cinfo);
     return NULL;
   }