From 1c73dd5c02b67fa9067041f46b07273fb0db7734 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 20 Nov 2024 21:05:54 +1100 Subject: [PATCH 1/4] Fix undefined behavior in raster overlays by updating Native. Also add an assertion to check for the problem. --- Source/CesiumRuntime/Private/CesiumGltfComponent.cpp | 4 ++++ extern/cesium-native | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp b/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp index b2781a59a..a5e094c96 100644 --- a/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp +++ b/Source/CesiumRuntime/Private/CesiumGltfComponent.cpp @@ -3387,6 +3387,10 @@ void UCesiumGltfComponent::AttachRasterTile( EMaterialParameterAssociation::LayerParameter, i), translationAndScale); + check( + textureCoordinateID >= 0 && + textureCoordinateID < + primData.overlayTextureCoordinateIDToUVIndex.size()); pMaterial->SetScalarParameterValueByInfo( FMaterialParameterInfo( "TextureCoordinateIndex", diff --git a/extern/cesium-native b/extern/cesium-native index fd22a9c80..7b731787d 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit fd22a9c80f47f5750ee39e64a727aac4ea6a62f5 +Subproject commit 7b731787dae3411a46b74ebdcf7e26f92b0e68a7 From 1b1571fdbbcd69412ddab32263bd6fc4e29218bb Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Wed, 20 Nov 2024 21:34:58 +1100 Subject: [PATCH 2/4] Update cesium-native. --- extern/cesium-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/cesium-native b/extern/cesium-native index 7b731787d..2ba26683e 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 7b731787dae3411a46b74ebdcf7e26f92b0e68a7 +Subproject commit 2ba26683e63cb99e54010ea685d6244c986624d1 From 027a8dc7506092f1ccc7cca08a64b7e350c9670c Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 21 Nov 2024 06:59:51 +1100 Subject: [PATCH 3/4] Adjust for changes in cesium-native. --- Source/CesiumRuntime/Private/CesiumBingMapsRasterOverlay.cpp | 1 - .../Private/CesiumWebMapTileServiceRasterOverlay.cpp | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Source/CesiumRuntime/Private/CesiumBingMapsRasterOverlay.cpp b/Source/CesiumRuntime/Private/CesiumBingMapsRasterOverlay.cpp index a538e8c69..bcc7c0046 100644 --- a/Source/CesiumRuntime/Private/CesiumBingMapsRasterOverlay.cpp +++ b/Source/CesiumRuntime/Private/CesiumBingMapsRasterOverlay.cpp @@ -43,6 +43,5 @@ UCesiumBingMapsRasterOverlay::CreateOverlay( TCHAR_TO_UTF8(*this->BingMapsKey), mapStyle, "", - CesiumGeospatial::Ellipsoid::WGS84, options); } diff --git a/Source/CesiumRuntime/Private/CesiumWebMapTileServiceRasterOverlay.cpp b/Source/CesiumRuntime/Private/CesiumWebMapTileServiceRasterOverlay.cpp index bd9a63fed..ecefeca4c 100644 --- a/Source/CesiumRuntime/Private/CesiumWebMapTileServiceRasterOverlay.cpp +++ b/Source/CesiumRuntime/Private/CesiumWebMapTileServiceRasterOverlay.cpp @@ -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) { From c5a09573e258675b90e9caa8542737ffec7710b0 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 21 Nov 2024 07:05:12 +1100 Subject: [PATCH 4/4] Update cesium-native. --- extern/cesium-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/cesium-native b/extern/cesium-native index 2ba26683e..970ab2414 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 2ba26683e63cb99e54010ea685d6244c986624d1 +Subproject commit 970ab241464c90fd1009dd4521cd77ea1d69b22d