summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortgl <tgl>2012-07-19 15:43:41 +0000
committertgl <tgl>2012-07-19 15:43:41 +0000
commitca8d7a84ca0cb8201fa0d53ad21cb1d8b6ae6163 (patch)
treeb345d22a0dbd927b576a9dd8c66d1dd8b61e4300
parent86e5f6d6895e1e7c491fb133b7ed814ad25be59c (diff)
downloadlibtiff-ca8d7a84ca0cb8201fa0d53ad21cb1d8b6ae6163.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 918369c6..57996e3e 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 a6b520f8..356328c1 100644
--- a/tools/tiff2pdf.c
+++ b/tools/tiff2pdf.c
@@ -1,4 +1,4 @@
-/* $Id: tiff2pdf.c,v 1.68 2012-07-18 15:07:55 tgl Exp $
+/* $Id: tiff2pdf.c,v 1.69 2012-07-19 15:43:41 tgl Exp $
*
* tiff2pdf - converts a TIFF image to a PDF document
*
@@ -3182,6 +3182,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);
@@ -5229,6 +5230,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",
(unsigned int) (t2p->pdf_xrefcount * sizeof(uint32)) );
+ t2p->t2p_error = T2P_ERR_ERROR;
return(written);
}
t2p->pdf_xrefcount=0;