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."); //