diff options
Diffstat (limited to 'main/file.c')
-rw-r--r-- | main/file.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/main/file.c b/main/file.c index f576c853b..abb7943d4 100644 --- a/main/file.c +++ b/main/file.c @@ -668,7 +668,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; |