From 395aa4cbcaf91ce37aeb5e9876c44291bed4d1f9 Mon Sep 17 00:00:00 2001 From: Peter Hillman Date: Thu, 11 Jul 2019 13:26:17 +1200 Subject: [PATCH] protect against negative sized tiles --- OpenEXR/IlmImf/ImfTiledInputFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenEXR/IlmImf/ImfTiledInputFile.cpp b/OpenEXR/IlmImf/ImfTiledInputFile.cpp index b5fbeb7043..15c51c50af 100644 --- a/OpenEXR/IlmImf/ImfTiledInputFile.cpp +++ b/OpenEXR/IlmImf/ImfTiledInputFile.cpp @@ -377,7 +377,7 @@ readTileData (InputStreamMutex *streamData, if (levelY != ly) throw IEX_NAMESPACE::InputExc ("Unexpected tile y level number coordinate."); - if (dataSize > (int) ifd->tileBufferSize) + if (dataSize < 0 || dataSize > static_cast(ifd->tileBufferSize) ) throw IEX_NAMESPACE::InputExc ("Unexpected tile block length."); //