From 5fbe407b98411245b32764f63a1dd5963855acb4 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Sat, 25 Feb 2006 04:23:48 +0000 Subject: [PATCH] ensure that spy frame queueing is able to deal with translation failing for any reason (issue #6546) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@11058 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channel.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/channel.c b/channel.c index 190c4a3105..5aacefd21f 100644 --- a/channel.c +++ b/channel.c @@ -1164,7 +1164,12 @@ static void queue_frame_to_spies(struct ast_channel *chan, struct ast_frame *f, trans->last_format = f->subclass; } } - translated_frame = ast_translate(trans->path, f, 0); + if (!(translated_frame = ast_translate(trans->path, f, 0))) { + ast_log(LOG_ERROR, "Translation to %s failed, dropping frame for spies\n", + ast_getformatname(AST_FORMAT_SLINEAR)); + ast_mutex_unlock(&spy->lock); + break; + } } for (last = queue->head; last && last->next; last = last->next);