diff options
author | fwarmerdam <fwarmerdam> | 2012-05-24 03:15:18 +0000 |
---|---|---|
committer | fwarmerdam <fwarmerdam> | 2012-05-24 03:15:18 +0000 |
commit | 945d78b87d03925d3ca7113e72cddc74f129f8a6 (patch) | |
tree | e46ca647e33b82ec1e060a52df3a023126740aeb | |
parent | 15cc717240db938e5c7fcee6efb821750df29ee2 (diff) | |
download | libtiff-945d78b87d03925d3ca7113e72cddc74f129f8a6.tar.gz |
if OJPEGWriteHeader() fails once do not bother trying again on the same image.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | libtiff/tif_ojpeg.c | 6 |
2 files changed, 7 insertions, 2 deletions
@@ -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)); |