From a6512959ac823ac89027ef373deff6f386920bb9 Mon Sep 17 00:00:00 2001 From: Peter Hillman Date: Thu, 25 Jul 2019 19:23:37 +1200 Subject: [PATCH] Fix for #494: validate tile coordinates when doing copyPixels --- OpenEXR/IlmImf/ImfTiledInputFile.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OpenEXR/IlmImf/ImfTiledInputFile.cpp b/OpenEXR/IlmImf/ImfTiledInputFile.cpp index 15c51c50af..bda7bad50a 100644 --- a/OpenEXR/IlmImf/ImfTiledInputFile.cpp +++ b/OpenEXR/IlmImf/ImfTiledInputFile.cpp @@ -1313,6 +1313,13 @@ TiledInputFile::rawTileData (int &dx, int &dy, throw IEX_NAMESPACE::ArgExc ("rawTileData read the wrong tile"); } } + else + { + if(!isValidTile (dx, dy, lx, ly) ) + { + throw IEX_NAMESPACE::IoExc ("rawTileData read an invalid tile"); + } + } pixelData = tileBuffer->buffer; } catch (IEX_NAMESPACE::BaseExc &e)