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>
diff --git a/third_party/libtiff/tif_packbits.c b/third_party/libtiff/tif_packbits.c
index 9e77190..d2a0165 100644
--- a/third_party/libtiff/tif_packbits.c
+++ b/third_party/libtiff/tif_packbits.c
@@ -1,4 +1,4 @@
-/* $Id: tif_packbits.c,v 1.22 2012-06-20 05:25:33 fwarmerdam Exp $ */
+/* $Id: tif_packbits.c,v 1.24 2016-09-04 21:32:56 erouault Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -38,7 +38,8 @@
{
(void) s;
- if (!(tif->tif_data = (uint8*)_TIFFmalloc(sizeof(tmsize_t))))
+ tif->tif_data = (uint8*)_TIFFmalloc(sizeof(tmsize_t));
+ if (tif->tif_data == NULL)
return (0);
/*
* Calculate the scanline/tile-width size in bytes.
@@ -81,7 +82,9 @@
/*
* Find the longest string of identical bytes.
*/
- b = *bp++, cc--, n = 1;
+ b = *bp++;
+ cc--;
+ n = 1;
for (; cc > 0 && b == *bp; cc--, bp++)
n++;
again:
@@ -222,7 +225,8 @@
bp = (char*) tif->tif_rawcp;
cc = tif->tif_rawcc;
while (cc > 0 && occ > 0) {
- n = (long) *bp++, cc--;
+ n = (long) *bp++;
+ cc--;
/*
* Watch out for compilers that
* don't sign extend chars...
@@ -241,7 +245,8 @@
n = (long)occ;
}
occ -= n;
- b = *bp++, cc--;
+ b = *bp++;
+ cc--;
while (n-- > 0)
*op++ = (uint8) b;
} else { /* copy next n+1 bytes literally */