diff options
Diffstat (limited to 'apps/talk.c')
-rw-r--r-- | apps/talk.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/talk.c b/apps/talk.c index 9f31645ca5..c327487962 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -540,7 +540,9 @@ void talk_init(void) | |||
540 | reset_state(); /* use this for most of our inits */ | 540 | reset_state(); /* use this for most of our inits */ |
541 | 541 | ||
542 | filehandle = open_voicefile(); | 542 | filehandle = open_voicefile(); |
543 | has_voicefile = (filehandle >= 0); /* test if we can open it */ | 543 | size_t audiobufsz = audiobufend - audiobuf; |
544 | /* test if we can open and if it fits in the audiobuffer */ | ||
545 | has_voicefile = filehandle >= 0 && filesize(filehandle) > (off_t)audiobufsz; | ||
544 | voicefile_size = 0; | 546 | voicefile_size = 0; |
545 | 547 | ||
546 | if (has_voicefile) | 548 | if (has_voicefile) |