Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(765)

Unified Diff: third_party/libtiff/tif_tile.c

Issue 1563103002: XFA: Upgrade to libtiff 4.0.6. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: rename to libtiff Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libtiff/tif_thunder.c ('k') | third_party/libtiff/tif_version.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libtiff/tif_tile.c
diff --git a/third_party/tiff_v403/tif_tile.c b/third_party/libtiff/tif_tile.c
similarity index 90%
rename from third_party/tiff_v403/tif_tile.c
rename to third_party/libtiff/tif_tile.c
index cb59a598e808d8c11f7c4ca3295c7b8df9e7ef61..388e168ac66b90c1c7ba6927707c17f38e7dab77 100644
--- a/third_party/tiff_v403/tif_tile.c
+++ b/third_party/libtiff/tif_tile.c
@@ -1,4 +1,4 @@
-/* $Id: tif_tile.c,v 1.23 2012-06-06 05:33:55 fwarmerdam Exp $ */
+/* $Id: tif_tile.c,v 1.24 2015-06-07 22:35:40 bfriesen Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
@@ -143,17 +143,40 @@ TIFFNumberOfTiles(TIFF* tif)
uint64
TIFFTileRowSize64(TIFF* tif)
{
+ static const char module[] = "TIFFTileRowSize64";
TIFFDirectory *td = &tif->tif_dir;
uint64 rowsize;
+ uint64 tilerowsize;
- if (td->td_tilelength == 0 || td->td_tilewidth == 0)
+ if (td->td_tilelength == 0)
+ {
+ TIFFErrorExt(tif->tif_clientdata,module,"Tile length is zero");
+ return 0;
+ }
+ if (td->td_tilewidth == 0)
+ {
+ TIFFErrorExt(tif->tif_clientdata,module,"Tile width is zero");
return (0);
+ }
rowsize = _TIFFMultiply64(tif, td->td_bitspersample, td->td_tilewidth,
"TIFFTileRowSize");
if (td->td_planarconfig == PLANARCONFIG_CONTIG)
+ {
+ if (td->td_samplesperpixel == 0)
+ {
+ TIFFErrorExt(tif->tif_clientdata,module,"Samples per pixel is zero");
+ return 0;
+ }
rowsize = _TIFFMultiply64(tif, rowsize, td->td_samplesperpixel,
"TIFFTileRowSize");
- return (TIFFhowmany8_64(rowsize));
+ }
+ tilerowsize=TIFFhowmany8_64(rowsize);
+ if (tilerowsize == 0)
+ {
+ TIFFErrorExt(tif->tif_clientdata,module,"Computed tile row size is zero");
+ return 0;
+ }
+ return (tilerowsize);
}
tmsize_t
TIFFTileRowSize(TIFF* tif)
@@ -297,4 +320,3 @@ _TIFFDefaultTileSize(TIFF* tif, uint32* tw, uint32* th)
* fill-column: 78
* End:
*/
-
« no previous file with comments | « third_party/libtiff/tif_thunder.c ('k') | third_party/libtiff/tif_version.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698