From 65b0414775f0674cfb9aff0863a5be8c0d72dfaa Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Sat, 13 Sep 2025 18:37:51 +0300 Subject: fix: Initialize uninitialized member variables This commit addresses cppcheck warnings about member variables that are not properly initialized in constructors (uninitMemberVar). Uninitialized member variables can lead to undefined behavior and unpredictable program execution, making this a critical bug fix. Changes made: - kmscube/cube-gles2.cpp: Initialize m_width and m_height to 0 in GlScene constructor to prevent undefined behavior when these values are used - utils/kmstest.cpp: Initialize m_frame_num and m_flip_count to 0 in FlipState constructor to ensure proper frame counting behavior These fixes prevent potential crashes and ensure deterministic behavior by providing proper initial values for all member variables. --- utils/kmstest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/kmstest.cpp') diff --git a/utils/kmstest.cpp b/utils/kmstest.cpp index c6efb45..36f7409 100644 --- a/utils/kmstest.cpp +++ b/utils/kmstest.cpp @@ -969,7 +969,7 @@ class FlipState : private PageFlipHandlerBase { public: FlipState(Card& card, const string& name, const vector& outputs) - : m_card(card), m_name(name), m_outputs(outputs) + : m_card(card), m_name(name), m_outputs(outputs), m_frame_num(0), m_flip_count(0) { } -- cgit v1.2.3