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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user