diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-02-18 20:53:25 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-02-18 20:53:25 +0000 |
commit | ddbb8442304130948befcd82ae326314fda1abaa (patch) | |
tree | 8958476d3b5f7896418a066c81a2796ecb4ab0c6 /main | |
parent | 449133f8966e662662e20caa0d58672728ad819a (diff) |
Merged revisions 103786 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r103786 | mmichelson | 2008-02-18 14:52:09 -0600 (Mon, 18 Feb 2008) | 10 lines
There was an invalid assumption when calculating the duration of a file that the filestream in question
was created properly. Unfortunately this led to a segfault in the situation where an unknown format was
specified in voicemail.conf and a voicemail was recorded. Now, we first check to be sure that the stream
was written correctly or else assume a zero duration.
(closes issue #12021)
Reported by: jakep
Tested by: putnopvut
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103787 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/app.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/app.c b/main/app.c index b70ef022f..99eaec3f6 100644 --- a/main/app.c +++ b/main/app.c @@ -760,7 +760,7 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile, * message, otherwise we could get a situation where this stream is never * closed (which would create a resource leak). */ - *duration = ast_tellstream(others[0]) / 8000; + *duration = others[0] ? ast_tellstream(others[0]) / 8000 : 0; if (!prepend) { for (x = 0; x < fmtcnt; x++) { |