]> git.tdb.fi Git - r2c2.git/commitdiff
Fix uninitialized variables in Intellibox driver
authorMikko Rasa <tdb@tdb.fi>
Thu, 11 Jul 2013 11:38:23 +0000 (14:38 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 11 Jul 2013 11:38:23 +0000 (14:38 +0300)
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

index 73c2057942edb295eba784d596336048048cd941..d4129ec7535162d44deb3225de1608423d76c759 100644 (file)
@@ -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)
 { }