diff --git a/MUNGA_L4/L4VIDRND.cpp b/MUNGA_L4/L4VIDRND.cpp index e183145..f570820 100644 --- a/MUNGA_L4/L4VIDRND.cpp +++ b/MUNGA_L4/L4VIDRND.cpp @@ -2805,6 +2805,7 @@ CameraShipHUDRenderable::CameraShipHUDRenderable(Entity *entity, ExecutionType e // playerRank = NULL; oldPlayerRank = NULL; + rankCount = 0; nameDCS = NULL; rankDCS = NULL; nameInstance = NULL; @@ -2848,6 +2849,18 @@ CameraShipHUDRenderable::CameraShipHUDRenderable(Entity *entity, ExecutionType e Verify(camera_player_count <= MAX_PLAYER_NAMES); playerRank = new (int (*[camera_player_count])); Register_Pointer(playerRank); + // + // Cleared, because the fill below is by bitmap index and leaves + // gaps: with a Live Cam host the racing players start at index 2 + // and nothing ever claims slot 0. new[] does not zero, so those + // gaps were uninitialised heap read as int* - the access + // violation in Execute. + // + rankCount = camera_player_count; + for (int slot = 0; slot < rankCount; ++slot) + { + playerRank[slot] = NULL; + } Player *active_player; if(player_group) { @@ -3095,8 +3108,14 @@ void CameraShipHUDRenderable::Execute() // whenever they change! //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // - for(int ii=0; ii