summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorbfriesen <bfriesen>2015-05-30 17:07:53 +0000
committerbfriesen <bfriesen>2015-05-30 17:07:53 +0000
commita7404a20359931ff6096533ee165be236042d715 (patch)
tree576d4730e9a5bc6534f1cc723a47b04fc3a43123 /tools
parentae42bb7226ae95c650fa6dffc74219aea59ba1d0 (diff)
downloadlibtiff-a7404a20359931ff6096533ee165be236042d715.tar.gz
* tools/tiff2pdf.c (t2p_readwrite_pdf_image): Fix Coverity 1024181
"Structurally dead code".
Diffstat (limited to 'tools')
-rw-r--r--tools/tiff2pdf.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
index a7687718..66a07891 100644
--- a/tools/tiff2pdf.c
+++ b/tools/tiff2pdf.c
@@ -1,4 +1,4 @@
-/* $Id: tiff2pdf.c,v 1.84 2015-05-30 15:33:54 bfriesen Exp $
+/* $Id: tiff2pdf.c,v 1.85 2015-05-30 17:07:53 bfriesen Exp $
*
* tiff2pdf - converts a TIFF image to a PDF document
*
@@ -2159,7 +2159,7 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
uint16 v_samp=1;
uint16 ri=1;
uint32 rows=0;
-#endif
+#endif /* ifdef OJPEG_SUPPORT */
#ifdef JPEG_SUPPORT
unsigned char* jpt;
float* xfloatp;
@@ -2167,7 +2167,7 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
unsigned char* stripbuffer;
tsize_t striplength=0;
uint32 max_striplength=0;
-#endif
+#endif /* ifdef JPEG_SUPPORT */
/* Fail if prior error (in particular, can't trust tiff_datasize) */
if (t2p->t2p_error != T2P_ERR_OK)
@@ -2202,7 +2202,7 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
_TIFFfree(buffer);
return(t2p->tiff_datasize);
}
-#endif
+#endif /* ifdef CCITT_SUPPORT */
#ifdef ZIP_SUPPORT
if (t2p->pdf_compression == T2P_COMPRESS_ZIP) {
buffer = (unsigned char*)
@@ -2227,7 +2227,7 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
_TIFFfree(buffer);
return(t2p->tiff_datasize);
}
-#endif
+#endif /* ifdef ZIP_SUPPORT */
#ifdef OJPEG_SUPPORT
if(t2p->tiff_compression == COMPRESSION_OJPEG) {
@@ -2339,14 +2339,21 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
t2pWriteFile(output, (tdata_t) buffer, bufferoffset);
_TIFFfree(buffer);
return(bufferoffset);
+#if 0
+ /*
+ This hunk of code removed code is clearly
+ mis-placed and we are not sure where it
+ should be (if anywhere)
+ */
TIFFError(TIFF2PDF_MODULE,
"No support for OJPEG image %s with no JPEG File Interchange offset",
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
+#endif
}
}
-#endif
+#endif /* ifdef OJPEG_SUPPORT */
#ifdef JPEG_SUPPORT
if(t2p->tiff_compression == COMPRESSION_JPEG) {
uint32 count = 0;
@@ -2408,7 +2415,7 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
_TIFFfree(buffer);
return(bufferoffset);
}
-#endif
+#endif /* ifdef JPEG_SUPPORT */
(void)0;
}
@@ -2625,7 +2632,7 @@ dataready:
case T2P_COMPRESS_G4:
TIFFSetField(output, TIFFTAG_COMPRESSION, COMPRESSION_CCITTFAX4);
break;
-#endif
+#endif /* ifdef CCITT_SUPPORT */
#ifdef JPEG_SUPPORT
case T2P_COMPRESS_JPEG:
if(t2p->tiff_photometric==PHOTOMETRIC_YCBCR) {
@@ -2671,7 +2678,7 @@ dataready:
}
break;
-#endif
+#endif /* ifdef JPEG_SUPPORT */
#ifdef ZIP_SUPPORT
case T2P_COMPRESS_ZIP:
TIFFSetField(output, TIFFTAG_COMPRESSION, COMPRESSION_DEFLATE);
@@ -2686,7 +2693,7 @@ dataready:
(t2p->pdf_defaultcompressionquality / 100));
}
break;
-#endif
+#endif /* ifdef ZIP_SUPPORT */
default:
break;
}
@@ -2700,7 +2707,7 @@ dataready:
buffer,
stripsize * stripcount);
} else
-#endif
+#endif /* ifdef JPEG_SUPPORT */
{
bufferoffset = TIFFWriteEncodedStrip(output, (tstrip_t)0,
buffer,