summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfwarmerdam <fwarmerdam>2012-05-24 03:15:18 +0000
committerfwarmerdam <fwarmerdam>2012-05-24 03:15:18 +0000
commit945d78b87d03925d3ca7113e72cddc74f129f8a6 (patch)
treee46ca647e33b82ec1e060a52df3a023126740aeb
parent15cc717240db938e5c7fcee6efb821750df29ee2 (diff)
downloadlibtiff-945d78b87d03925d3ca7113e72cddc74f129f8a6.tar.gz
if OJPEGWriteHeader() fails once do not bother trying again on the same image.
-rw-r--r--ChangeLog3
-rw-r--r--libtiff/tif_ojpeg.c6
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 365ed7bf..47d9e014 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2012-05-23 Frank Warmerdam <warmerdam@google.com>
+ * libtiff/tif_ojpeg.c: if OJPEGWriteHeader() fails once do not bother trying again on
+ the same image.
+
* libtiff/tif_ojpeg.c: make things more resilient in the face of files without
stripbytecounts or stripoffsets or where loading these fails.
diff --git a/libtiff/tif_ojpeg.c b/libtiff/tif_ojpeg.c
index 105100bc..6ea3c38b 100644
--- a/libtiff/tif_ojpeg.c
+++ b/libtiff/tif_ojpeg.c
@@ -1,4 +1,4 @@
-/* $Id: tif_ojpeg.c,v 1.55 2012-05-24 02:43:51 fwarmerdam Exp $ */
+/* $Id: tif_ojpeg.c,v 1.56 2012-05-24 03:15:18 fwarmerdam Exp $ */
/* WARNING: The type of JPEG encapsulation defined by the TIFF Version 6.0
specification is now totally obsolete and deprecated for new applications and
@@ -1146,7 +1146,9 @@ OJPEGWriteHeaderInfo(TIFF* tif)
OJPEGState* sp=(OJPEGState*)tif->tif_data;
uint8** m;
uint32 n;
- assert(sp->libjpeg_session_active==0);
+ /* if a previous attempt failed, don't try again */
+ if (sp->libjpeg_session_active != 0)
+ return 0;
sp->out_state=ososSoi;
sp->restart_index=0;
jpeg_std_error(&(sp->libjpeg_jpeg_error_mgr));