Fix segfault when trying to load corrupt orthophoto
This commit is contained in:
parent
00ff35cdb7
commit
f72ff7d2a2
@ -219,6 +219,9 @@ namespace simgear {
|
|||||||
path.concat(".png");
|
path.concat(".png");
|
||||||
if (path.exists()) {
|
if (path.exists()) {
|
||||||
ImageRef image = osgDB::readRefImageFile(path.str());
|
ImageRef image = osgDB::readRefImageFile(path.str());
|
||||||
|
if (!image) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
image->flipVertical();
|
image->flipVertical();
|
||||||
OrthophotoBounds bbox = OrthophotoBounds::fromBucket(bucket);
|
OrthophotoBounds bbox = OrthophotoBounds::fromBucket(bucket);
|
||||||
return new Orthophoto(image, bbox);
|
return new Orthophoto(image, bbox);
|
||||||
|
Loading…
Reference in New Issue
Block a user