commit | 882a190807b6f791e3b3f1a692c59fb93d746f94 | [log] [tgz] |
---|---|---|
author | Lei Zhang <thestig@chromium.org> | Fri Nov 03 20:35:36 2017 +0000 |
committer | Chromium commit bot <commit-bot@chromium.org> | Fri Nov 03 20:35:36 2017 +0000 |
tree | 6b1f9c2e806df91aa9c8b5ab0842642c69cdd99f | |
parent | e18ac44ddc7eb98e5301e40b5cb19c88215cda13 [diff] |
Check for NULL pointer in _TIFFfree(). 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>
diff --git a/core/fxcodec/codec/ccodec_tiffmodule.cpp b/core/fxcodec/codec/ccodec_tiffmodule.cpp index 0fcd9f3..a5b70c6 100644 --- a/core/fxcodec/codec/ccodec_tiffmodule.cpp +++ b/core/fxcodec/codec/ccodec_tiffmodule.cpp
@@ -73,7 +73,8 @@ } void _TIFFfree(void* ptr) { - FXMEM_DefaultFree(ptr, 0); + if (ptr) + FXMEM_DefaultFree(ptr, 0); } void* _TIFFrealloc(void* ptr, tmsize_t size) {