From 04b9086adde7507517b136fe5bdb6780466f806e Mon Sep 17 00:00:00 2001 From: doterop Date: Wed, 29 Jul 2020 17:05:23 +0200 Subject: [PATCH] Fixed unsigned mistmatch --- .../Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp index bba7eab1a..962db5986 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/SceneCaptureSensor.cpp @@ -563,8 +563,9 @@ bool ASceneCaptureSensor::CopyTextureFromAtlas( // Check that the atlas alreay contains our texture // and our image has been initialized - if(AtlasImage.GetData() && - AtlasImage.Num() < (PositionInAtlas.Y * AtlasTextureWidth + ImageWidth * ImageHeight)) + uint32 ExpectedSize = (uint32)(PositionInAtlas.Y * AtlasTextureWidth + ImageWidth * ImageHeight); + uint32 TotalSize = (uint32)AtlasImage.Num(); + if(AtlasImage.GetData() && TotalSize < ExpectedSize) { return false; }