Skip to content

Commit 7f11af0

Browse files
committed
QueueFromVector: memory corruption
1 parent 726210a commit 7f11af0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/AudioBasic/Collections/QueueFromVector.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ class QueueFromVector {
4141
_end_pos = 0;
4242
return false;
4343
}
44+
// provide data at haed
4445
data = vector[0];
46+
// shift all data to the left by 1 position
4547
memmove(&vector[0], &vector[1], (_end_pos-1)*sizeof(T));
46-
vector[_end_pos--] = null_value;
48+
vector[--_end_pos] = null_value;
4749
return true;
4850
}
4951

0 commit comments

Comments
 (0)