From a78341e26c7bf5733abe7c984b25e718a15aeb48 Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Tue, 25 Jun 2019 14:23:20 -0700 Subject: [PATCH] Fix potential null pointer is passed into memcpy --- src/libImaging/TiffDecode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libImaging/TiffDecode.c b/src/libImaging/TiffDecode.c index a68f73993..871b0bcdb 100644 --- a/src/libImaging/TiffDecode.c +++ b/src/libImaging/TiffDecode.c @@ -194,6 +194,9 @@ int ReadTile(TIFF* tiff, UINT32 col, UINT32 row, UINT32* buffer) { } swap_line = (UINT32*)malloc(swap_line_size); + if (swap_line == NULL) { + return -1; + } /* * For some reason the TIFFReadRGBATile() function chooses the * lower left corner as the origin. Vertically mirror scanlines.