summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-11-03 20:35:36 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-03 20:35:36 +0000
commit882a190807b6f791e3b3f1a692c59fb93d746f94 (patch)
tree6b1f9c2e806df91aa9c8b5ab0842642c69cdd99f
parente18ac44ddc7eb98e5301e40b5cb19c88215cda13 (diff)
downloadpdfium-chromium/3258.tar.xz
Check for NULL pointer in _TIFFfree().chromium/3258
PartitionAlloc does not handle free(NULL), so _TIFFfree() needs to do the check, just like png_free_default() and _cmsFree() for other third party code. BUG=chromium:780709 Change-Id: I4e2ff0ba642c66e4a73e151c9ab42ebb42d34a5b Reviewed-on: https://pdfium-review.googlesource.com/17791 Reviewed-by: Chris Palmer <palmer@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
-rw-r--r--core/fxcodec/codec/ccodec_tiffmodule.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/fxcodec/codec/ccodec_tiffmodule.cpp b/core/fxcodec/codec/ccodec_tiffmodule.cpp
index 0fcd9f3a99..a5b70c6899 100644
--- a/core/fxcodec/codec/ccodec_tiffmodule.cpp
+++ b/core/fxcodec/codec/ccodec_tiffmodule.cpp
@@ -73,7 +73,8 @@ void* _TIFFmalloc(tmsize_t size) {
}
void _TIFFfree(void* ptr) {
- FXMEM_DefaultFree(ptr, 0);
+ if (ptr)
+ FXMEM_DefaultFree(ptr, 0);
}
void* _TIFFrealloc(void* ptr, tmsize_t size) {