From f4b1ac84400a95e1a9fe68ff00bcd52e44911cf2 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 11 Jul 2013 14:38:23 +0300 Subject: [PATCH] Fix uninitialized variables in Intellibox driver Uninitialized pending_half_step caused wonky loco speed events to be emitted, resulting in out-of-bounds access in speed quantizer. --- source/libr2c2/intellibox.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/libr2c2/intellibox.cpp b/source/libr2c2/intellibox.cpp index 73c2057..d4129ec 100644 --- a/source/libr2c2/intellibox.cpp +++ b/source/libr2c2/intellibox.cpp @@ -740,10 +740,12 @@ void Intellibox::error(Command cmd, Error err) Intellibox::Locomotive::Locomotive(): + protocol(NONE), ext_func(false), speed(0), reverse(false), - funcs(0) + funcs(0), + pending_half_step(0) { } -- 2.45.2