From: Olle Johansson Date: Sat, 11 Sep 2010 17:05:16 +0000 (+0000) Subject: Merged revisions 286267 via svnmerge from X-Git-Tag: 1.6.2.14-rc1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99d4e66a56eeacb5d78a5986452b4f74476640d6;p=thirdparty%2Fasterisk.git Merged revisions 286267 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r286267 | oej | 2010-09-11 18:59:20 +0200 (Lör, 11 Sep 2010) | 4 lines Handle error response when we can't make file compatible Review: https://reviewboard.asterisk.org/r/911/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@286268 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/file.c b/main/file.c index 98c0f208c2..ae67f8bc95 100644 --- a/main/file.c +++ b/main/file.c @@ -653,7 +653,10 @@ struct ast_filestream *ast_openstream_full(struct ast_channel *chan, const char chan->oldwriteformat = chan->writeformat; /* Set the channel to a format we can work with */ res = ast_set_write_format(chan, fmts); - res = ast_filehelper(buf, chan, NULL, ACTION_OPEN); + if (res == -1) { /* No format available that works with this channel */ + return NULL; + } + res = ast_filehelper(buf, chan, NULL, ACTION_OPEN); if (res >= 0) return chan->stream; return NULL;