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];