summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortgl <tgl>2012-07-19 15:43:31 +0000
committertgl <tgl>2012-07-19 15:43:31 +0000
commit802d1a97ef25f383c0638bafcd9b4f6635e96938 (patch)
tree2ce3701076d7693ab209a70cce540eccfb29ee66
parent10f4a9820106630a93ee1da2c5e099997ac5dbd1 (diff)
downloadlibtiff-802d1a97ef25f383c0638bafcd9b4f6635e96938.tar.gz
Fix a couple more tiff2pdf bugs.
-rw-r--r--ChangeLog6
-rw-r--r--tools/tiff2pdf.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0fc67737..c1bb280d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-07-19 Tom Lane <tgl@sss.pgh.pa.us>
+
+ * tools/tiff2pdf.c: Fix two places where t2p_error didn't get set
+ after a malloc failure. No crash risk AFAICS, but the program
+ might not report exit code 1 as desired. h/t mancha@mac.hush.com
+
2012-07-18 Tom Lane <tgl@sss.pgh.pa.us>
* tools/tiff2pdf.c: Fail when TIFFSetDirectory() fails. This
diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
index e2afe103..dee64358 100644
--- a/tools/tiff2pdf.c
+++ b/tools/tiff2pdf.c
@@ -1,4 +1,4 @@
-/* $Id: tiff2pdf.c,v 1.37.2.21 2012-07-18 15:08:09 tgl Exp $
+/* $Id: tiff2pdf.c,v 1.37.2.22 2012-07-19 15:43:31 tgl Exp $
*
* tiff2pdf - converts a TIFF image to a PDF document
*
@@ -3178,6 +3178,7 @@ int t2p_process_ojpeg_tables(T2P* t2p, TIFF* input){
"Can't allocate %u bytes of memory for t2p_process_ojpeg_tables, %s",
2048,
TIFFFileName(input));
+ t2p->t2p_error = T2P_ERR_ERROR;
return(0);
}
_TIFFmemset(t2p->pdf_ojpegdata, 0x00, 2048);
@@ -5225,6 +5226,7 @@ tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){
TIFF2PDF_MODULE,
"Can't allocate %u bytes of memory for t2p_write_pdf",
t2p->pdf_xrefcount * sizeof(uint32) );
+ t2p->t2p_error = T2P_ERR_ERROR;
return(written);
}
t2p->pdf_xrefcount=0;