Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix raster overlay undefined behavior #1554

Merged
merged 8 commits into from
Nov 25, 2024
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,5 @@ UCesiumBingMapsRasterOverlay::CreateOverlay(
TCHAR_TO_UTF8(*this->BingMapsKey),
mapStyle,
"",
CesiumGeospatial::Ellipsoid::WGS84,
options);
}
4 changes: 4 additions & 0 deletions Source/CesiumRuntime/Private/CesiumGltfComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3393,6 +3393,10 @@ void UCesiumGltfComponent::AttachRasterTile(
EMaterialParameterAssociation::LayerParameter,
i),
translationAndScale);
check(
textureCoordinateID >= 0 &&
textureCoordinateID <
primData.overlayTextureCoordinateIDToUVIndex.size());
pMaterial->SetScalarParameterValueByInfo(
FMaterialParameterInfo(
"TextureCoordinateIndex",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ UCesiumWebMapTileServiceRasterOverlay::CreateOverlay(
wmtsOptions.tileWidth = this->TileWidth;
wmtsOptions.tileHeight = this->TileHeight;

const CesiumGeospatial::Ellipsoid& ellipsoid =
options.ellipsoid.value_or(CesiumGeospatial::Ellipsoid::WGS84);
const CesiumGeospatial::Ellipsoid& ellipsoid = options.ellipsoid;

if (this->Projection ==
ECesiumWebMapTileServiceRasterOverlayProjection::Geographic) {
Expand Down