summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-10-04 17:45:54 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-10-04 17:45:54 +0200
commitc7af1c332447e5fb25f37d4738458a5d7106a6fc (patch)
treef331c194dc985ba8d646d925ba727e39413010d1
parent3e819cf15ed4e495bd616abdd721521656f56211 (diff)
Fix crash bug.
-rw-r--r--src/drumgizmo.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc
index 1abbb10..0337fae 100644
--- a/src/drumgizmo.cc
+++ b/src/drumgizmo.cc
@@ -333,6 +333,7 @@ void DrumGizmo::getSamples(int ch, int pos, sample_t *s, size_t sz)
if(evt->offset > (size_t)pos) n = evt->offset - pos;
size_t end = sz;
if(evt->t + end - n > af->size) end = af->size - evt->t + n;
+ if(end > sz) end = sz;
if(evt->rampdown == NO_RAMPDOWN) {
#ifdef SSE