Added an explicit check for file extension so that only .jpg and .jpeg files
are loaded with the JPEG plugin, thus avoid a crash which was occuring when it was passed non JPEG files.
This commit is contained in:
parent
8498422d7e
commit
0b75a59cfe
@ -281,6 +281,8 @@ class ReaderWriterJPEG : public osgDB::ReaderWriter
|
||||
|
||||
virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
std::string ext = osgDB::getFileExtension(fileName);
|
||||
if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
unsigned char *imageData = NULL;
|
||||
int width_ret;
|
||||
|
Loading…
Reference in New Issue
Block a user