[asterisk-commits] tilghman: branch 1.6.0 r135942 - in /branches/1.6.0: ./ main/translate.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Aug 5 22:30:24 CDT 2008
Author: tilghman
Date: Tue Aug 5 22:30:23 2008
New Revision: 135942
URL: http://svn.digium.com/view/asterisk?view=rev&rev=135942
Log:
Merged revisions 135938 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r135938 | tilghman | 2008-08-05 22:29:42 -0500 (Tue, 05 Aug 2008) | 12 lines
Merged revisions 135915 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r135915 | tilghman | 2008-08-05 22:24:56 -0500 (Tue, 05 Aug 2008) | 4 lines
Since powerof() can return an error condition, it's foolhardy not to detect and
deal with that condition.
(Related to issue #13240)
........
................
Modified:
branches/1.6.0/ (props changed)
branches/1.6.0/main/translate.c
Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.0/main/translate.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/translate.c?view=diff&rev=135942&r1=135941&r2=135942
==============================================================================
--- branches/1.6.0/main/translate.c (original)
+++ branches/1.6.0/main/translate.c Tue Aug 5 22:30:23 2008
@@ -265,7 +265,12 @@
source = powerof(source);
dest = powerof(dest);
-
+
+ if (source == -1 || dest == -1) {
+ ast_log(LOG_WARNING, "No translator path: (%s codec is not valid)\n", source == -1 ? "starting" : "ending");
+ return NULL;
+ }
+
AST_RWLIST_RDLOCK(&translators);
while (source != dest) {
@@ -625,6 +630,10 @@
t->dstfmt = powerof(t->dstfmt);
t->active = 1;
+ if (t->srcfmt == -1 || t->dstfmt == -1) {
+ ast_log(LOG_WARNING, "Invalid translator path: (%s codec is not valid)\n", t->srcfmt == -1 ? "starting" : "ending");
+ return -1;
+ }
if (t->plc_samples) {
if (t->buffer_samples < t->plc_samples) {
ast_log(LOG_WARNING, "plc_samples %d buffer_samples %d\n",
@@ -794,6 +803,10 @@
src = powerof(src);
dest = powerof(dest);
+ if (src == -1 || dest == -1) {
+ ast_log(LOG_WARNING, "No translator path: (%s codec is not valid)\n", src == -1 ? "starting" : "ending");
+ return -1;
+ }
AST_RWLIST_RDLOCK(&translators);
if (tr_matrix[src][dest].step)
More information about the asterisk-commits
mailing list