From 882a190807b6f791e3b3f1a692c59fb93d746f94 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 3 Nov 2017 20:35:36 +0000 Subject: 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 Commit-Queue: Lei Zhang --- core/fxcodec/codec/ccodec_tiffmodule.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/fxcodec') 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) { -- cgit v1.2.3