projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed potential off-by-one buffer overflow bug when recording tapes
[rocksndiamonds.git]
/
src
/
tape.c
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++;
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();
tape.length = tape.counter;
tape.length_frames = GetTapeLengthFrames();