aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-18 20:52:09 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-18 20:52:09 +0000
commit55b1d0a55de701ecc743dea3fe008ed404774fe6 (patch)
tree591fcdf0231d90f2c41c5ed7a4c9018ea2479077 /main
parentd8f0dbd76da41739f98e1637c6d75717b3481840 (diff)
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/branches/1.4@103786 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/app.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/app.c b/main/app.c
index d59f1d1cc..a71f46adc 100644
--- a/main/app.c
+++ b/main/app.c
@@ -707,7 +707,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++) {