summaryrefslogtreecommitdiff
path: root/third_party/libtiff/tif_strip.c
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-03-20 15:46:06 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-03-21 13:12:16 +0000
commitcfb6f46473777e444c8124318aa78d33aae64459 (patch)
tree272d17a7ba02251fd6d62a90c431e5af169af85a /third_party/libtiff/tif_strip.c
parent34a28b470a9a4d7c7edd04e9b6a1e02a7490e58b (diff)
downloadpdfium-cfb6f46473777e444c8124318aa78d33aae64459.tar.xz
Upgrade libtiff to 4.0.7.
Change-Id: If3f67767f738b7f23230ca8c37c9af2e31696e82 Reviewed-on: https://pdfium-review.googlesource.com/3117 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'third_party/libtiff/tif_strip.c')
-rw-r--r--third_party/libtiff/tif_strip.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/third_party/libtiff/tif_strip.c b/third_party/libtiff/tif_strip.c
index 6cac71dd92..b6098dd312 100644
--- a/third_party/libtiff/tif_strip.c
+++ b/third_party/libtiff/tif_strip.c
@@ -1,4 +1,4 @@
-/* $Id: tif_strip.c,v 1.36 2015-06-07 22:35:40 bfriesen Exp $ */
+/* $Id: tif_strip.c,v 1.37 2016-11-09 23:00:49 erouault Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
@@ -63,6 +63,15 @@ TIFFNumberOfStrips(TIFF* tif)
TIFFDirectory *td = &tif->tif_dir;
uint32 nstrips;
+ /* If the value was already computed and store in td_nstrips, then return it,
+ since ChopUpSingleUncompressedStrip might have altered and resized the
+ since the td_stripbytecount and td_stripoffset arrays to the new value
+ after the initial affectation of td_nstrips = TIFFNumberOfStrips() in
+ tif_dirread.c ~line 3612.
+ See http://bugzilla.maptools.org/show_bug.cgi?id=2587 */
+ if( td->td_nstrips )
+ return td->td_nstrips;
+
nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
if (td->td_planarconfig == PLANARCONFIG_SEPARATE)