projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ab6e77
)
fixed potential off-by-one buffer overflow bug when recording tapes
author
Holger Schemel
<info@artsoft.org>
Wed, 10 Jan 2018 09:41:23 +0000
(10:41 +0100)
committer
Holger Schemel
<info@artsoft.org>
Wed, 10 Jan 2018 09:41:23 +0000
(10:41 +0100)
src/tape.c
patch
|
blob
|
history
diff --git
a/src/tape.c
b/src/tape.c
index 831659b62cb881ac47353c1e37992d3917c8d57b..5e55cb0453fad9166df5de9c971aaba03950abfc 100644
(file)
--- a/
src/tape.c
+++ b/
src/tape.c
@@
-641,7
+641,10
@@
void TapeHaltRecording()
return;
tape.counter++;
- tape.pos[tape.counter].delay = 0;
+
+ // initialize delay for next tape entry (to be able to continue recording)
+ if (tape.counter < MAX_TAPE_LEN)
+ tape.pos[tape.counter].delay = 0;
tape.length = tape.counter;
tape.length_frames = GetTapeLengthFrames();