diff options
author | Nicolas Pena <npm@chromium.org> | 2017-04-18 15:36:29 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-18 20:24:11 +0000 |
commit | 152bfe0f60763263e8bf7292762885eb2aec9b85 (patch) | |
tree | 0ab40515446a4a4d8c779d39aae0707682a9fffe /third_party/libtiff/tif_read.c | |
parent | 9bd8b4c8687cc95bed5df131ca8764f9ce203944 (diff) | |
download | pdfium-152bfe0f60763263e8bf7292762885eb2aec9b85.tar.xz |
Libtiff upstream: _TIFFcalloc addition
Upstream commit:
https://github.com/vadz/libtiff/commit/d60332057b9575ada4f264489582b13e30137be1
Bug: chromium:711638
Change-Id: I46de1a00f9bb8d5de8df64ec78a9d62dcb4352ed
Reviewed-on: https://pdfium-review.googlesource.com/4310
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'third_party/libtiff/tif_read.c')
-rw-r--r-- | third_party/libtiff/tif_read.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/third_party/libtiff/tif_read.c b/third_party/libtiff/tif_read.c index c25e7e79f0..47686a473a 100644 --- a/third_party/libtiff/tif_read.c +++ b/third_party/libtiff/tif_read.c @@ -983,9 +983,9 @@ TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size) "Invalid buffer size"); return (0); } - tif->tif_rawdata = (uint8*) _TIFFmalloc(tif->tif_rawdatasize); - if (tif->tif_rawdata) - memset(tif->tif_rawdata, 0, tif->tif_rawdatasize); + /* Initialize to zero to avoid uninitialized buffers in case of */ + /* short reads (http://bugzilla.maptools.org/show_bug.cgi?id=2651) */ + tif->tif_rawdata = (uint8*) _TIFFcalloc(1, tif->tif_rawdatasize); tif->tif_flags |= TIFF_MYBUFFER; } |