diff --git a/src/osgPlugins/tiff/ReaderWriterTIFF.cpp b/src/osgPlugins/tiff/ReaderWriterTIFF.cpp index 5f66169f0..e463b7825 100644 --- a/src/osgPlugins/tiff/ReaderWriterTIFF.cpp +++ b/src/osgPlugins/tiff/ReaderWriterTIFF.cpp @@ -183,6 +183,14 @@ toff_t libtiffOStreamSeekProc(thandle_t fd, toff_t off, int i) { case SEEK_SET: { + if (off==0) + { + std::ostream::streampos checkEmpty = fout->tellp(); + if(checkEmpty < 0) + { + return 0; + } + } pos_required = off; fout->seekp(0, std::ios::end);