From cedb91fdea10e61bf0de3a05edd823581082e70e Mon Sep 17 00:00:00 2001 From: Dillon Skaggs Date: Mon, 19 Aug 2024 10:55:41 -0500 Subject: [PATCH] tweak(conhost): use circular_buffer instead of ImVector - `Items` and `ItemKeys` use a circular buffer and can only store `2500` items, but ItemTimes could expand and store more. - This would cause a crash at https://github.com/citizenfx/fivem/blob/705cd7901ac03c5a0d1e1355d94e84046309b80d/code/components/conhost-v2/src/ConsoleHostGui.cpp#L729-L734 because `ItemTimes` would have a capacity of 2500+ but `Items` and ItemKeys` would be empty --- code/components/conhost-v2/src/ConsoleHostGui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/components/conhost-v2/src/ConsoleHostGui.cpp b/code/components/conhost-v2/src/ConsoleHostGui.cpp index 5119fade79..00f8ae76c3 100644 --- a/code/components/conhost-v2/src/ConsoleHostGui.cpp +++ b/code/components/conhost-v2/src/ConsoleHostGui.cpp @@ -684,7 +684,7 @@ auto msec() struct MiniConsole : CfxBigConsole { - ImVector ItemTimes; + boost::circular_buffer ItemTimes{ 2500 }; ConVar* m_miniconChannels; std::string m_miniconLastValue;