From Paul Martz, "Attached are some minor plugin fixes. PNM, RGB, and JPEG would all crash if attempting to read an empty file, and FLT would go into an infinite loop. All are fixed with this change.

I also fixed some return values for a couple of these, changing FILE_NOT_HANDLED to ERROR_IN_READING_FILE where appropriate."
This commit is contained in:
Robert Osfield
2008-05-09 11:27:03 +00:00
parent 01f58ffbb2
commit 61e3285ffc
4 changed files with 12 additions and 3 deletions

View File

@@ -168,6 +168,8 @@ static rawImageRec *RawImageOpen(std::istream& fin)
}
fin.read((char*)raw,12);
if (!fin.good())
return NULL;
if (raw->swapFlag)
{
@@ -459,7 +461,7 @@ class ReaderWriterRGB : public osgDB::ReaderWriter
if( (raw = RawImageOpen(fin)) == NULL )
{
return ReadResult::FILE_NOT_HANDLED;
return ReadResult::ERROR_IN_READING_FILE;
}
int s = raw->sizeX;