Skip to content

Commit

Permalink
1.7B: Fixes for buffer overread on scale selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Chysn committed Jan 18, 2019
1 parent d1ae0d3 commit 89e85b0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion software/o_c_REV/HEM_ASR.ino
Expand Up @@ -73,7 +73,7 @@ public:
}
if (cursor == 1) { // Scale selection
scale += direction;
if (scale == OC::Scales::NUM_SCALES) scale = 0;
if (scale >= OC::Scales::NUM_SCALES) scale = 0;
if (scale < 0) scale = OC::Scales::NUM_SCALES - 1;
quantizer.Configure(OC::Scales::GetScale(scale), 0xffff);
}
Expand Down
4 changes: 2 additions & 2 deletions software/o_c_REV/HEM_DualQuant.ino
Expand Up @@ -75,8 +75,8 @@ public:
if (cursor == 0 || cursor == 2) {
// Scale selection
scale[ch] += direction;
if (scale[ch] == OC::Scales::NUM_SCALES) scale[ch] = 0;
if (scale[ch] < 0) scale[cursor] = OC::Scales::NUM_SCALES - 1;
if (scale[ch] >= OC::Scales::NUM_SCALES) scale[ch] = 0;
if (scale[ch] < 0) scale[ch] = OC::Scales::NUM_SCALES - 1;
quantizer[ch].Configure(OC::Scales::GetScale(scale[ch]), 0xffff);
continuous[ch] = 1; // Re-enable continuous mode when scale is changed
} else {
Expand Down
2 changes: 1 addition & 1 deletion software/o_c_REV/HEM_Squanch.ino
Expand Up @@ -72,7 +72,7 @@ public:
void OnEncoderMove(int direction) {
if (cursor == 2) { // Scale selection
scale += direction;
if (scale == OC::Scales::NUM_SCALES) scale = 0;
if (scale >= OC::Scales::NUM_SCALES) scale = 0;
if (scale < 0) scale = OC::Scales::NUM_SCALES - 1;
quantizer.Configure(OC::Scales::GetScale(scale), 0xffff);
continuous = 1; // Re-enable continuous mode when scale is changed
Expand Down
2 changes: 1 addition & 1 deletion software/o_c_REV/OC_version.h
Expand Up @@ -3,5 +3,5 @@
//
// GENERATED FILE, DO NOT EDIT
//
#define OC_VERSION "v1.8RC"
#define OC_VERSION "v1.7B"
#endif

0 comments on commit 89e85b0

Please sign in to comment.