Skip to content

Commit

Permalink
Avoid possible division by zero.
Browse files Browse the repository at this point in the history
  • Loading branch information
skullernet committed Nov 1, 2022
1 parent ca54fa3 commit be9099a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ void CL_FirstDemoFrame(void)
// obtain file length and offset of the second frame
len = FS_Length(cls.demo.playback);
ofs = FS_Tell(cls.demo.playback);
if (len > 0 && ofs > 0) {
if (ofs > 0 && ofs < len) {
cls.demo.file_offset = ofs;
cls.demo.file_size = len - ofs;
}
Expand Down

0 comments on commit be9099a

Please sign in to comment.