Skip to content

Commit

Permalink
Fix potential segfault when reading sentences.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeSlave authored and a1batross committed Sep 20, 2019
1 parent 70c4279 commit cb51d2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dlls/sound.cpp
Expand Up @@ -1281,9 +1281,9 @@ void SENTENCEG_Init()
if( !buffer[j] )
continue;

if( gcallsentences > CVOXFILESENTENCEMAX )
if( gcallsentences >= CVOXFILESENTENCEMAX )
{
ALERT( at_error, "Too many sentences in sentences.txt!\n" );
ALERT( at_error, "Too many sentences in sentences.txt! >%d\n", gcallsentences );
break;
}

Expand Down

0 comments on commit cb51d2a

Please sign in to comment.