From f7bbb4821b29d99eb87a2f9e12434128ce1179ef Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 28 Jun 2016 09:32:38 +0100 Subject: [PATCH] Added handling of failure to reclaim file --- src/osgPlugins/txp/trpage_readbuf.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osgPlugins/txp/trpage_readbuf.cpp b/src/osgPlugins/txp/trpage_readbuf.cpp index dbebf6e46..8cdd2a6a1 100644 --- a/src/osgPlugins/txp/trpage_readbuf.cpp +++ b/src/osgPlugins/txp/trpage_readbuf.cpp @@ -667,6 +667,12 @@ trpgrAppFile *trpgrAppFileCache::GetFile(trpgEndian ness,int id,int col,int row) } } + if (oldID<0) + { + // oldID hasn't been set so we haven't found one to reclaim + return 0; + } + // Reclaim this one OpenFile &of = files[oldID];