projects
/
ardour.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
92dba5b
)
Mackie Control: fix math error that tried to change bank to very high number
author
Len Ovens
<len@ovenwerks.net>
Sat, 16 Jan 2016 19:17:52 +0000
(11:17 -0800)
committer
Len Ovens
<len@ovenwerks.net>
Sat, 16 Jan 2016 19:17:52 +0000
(11:17 -0800)
libs/surfaces/mackie/mackie_control_protocol.cc
patch
|
blob
|
history
diff --git
a/libs/surfaces/mackie/mackie_control_protocol.cc
b/libs/surfaces/mackie/mackie_control_protocol.cc
index 97f96157d0b838dc3dbdfae46cd17b2a79ff4e33..2580fa9672c2ef0e098e3dea9581466956a59186 100644
(file)
--- a/
libs/surfaces/mackie/mackie_control_protocol.cc
+++ b/
libs/surfaces/mackie/mackie_control_protocol.cc
@@
-1301,7
+1301,11
@@
MackieControlProtocol::notify_remote_id_changed()
if (sorted.size() - _current_initial_bank < sz) {
// but don't shift backwards past the zeroth channel
- switch_banks (max((Sorted::size_type) 0, sorted.size() - sz));
+ if (sorted.size() < sz) { // avoid unsigned math mistake below
+ switch_banks(0, true);
+ } else {
+ switch_banks (max((Sorted::size_type) 0, sorted.size() - sz), true);
+ }
} else {
// Otherwise just refresh the current bank
refresh_current_bank();