<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6963">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Matthew Fredrickson: Looks good to me, approved
  Joshua Colp: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">core: Don't attempt to write to a stream that does not exist.<br><br>When a frame is provided to ast_write ensure that a multistream<br>capable channel has a stream for it before attempting to give it<br>to the channel driver. In some cases (such as a deferred SDP<br>negotiation) the stream may not yet exist.<br><br>ASTERISK-27364<br><br>Change-Id: Icf84ca982a67cdd6e9a71851eb7eb1bd0e865276<br>---<br>M main/channel.c<br>1 file changed, 15 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/channel.c b/main/channel.c<br>index 7d6e5db..7eb40d1 100644<br>--- a/main/channel.c<br>+++ b/main/channel.c<br>@@ -5054,7 +5054,11 @@<br>    case AST_FRAME_VIDEO:<br>                 /* XXX Handle translation of video codecs one day XXX */<br>              if (ast_channel_tech(chan)->write_stream) {<br>-                       res = ast_channel_tech(chan)->write_stream(chan, ast_stream_get_position(stream), fr);<br>+                    if (stream) {<br>+                                res = ast_channel_tech(chan)->write_stream(chan, ast_stream_get_position(stream), fr);<br>+                    } else {<br>+                             res = 0;<br>+                     }<br>             } else if ((stream == default_stream) && ast_channel_tech(chan)->write_video) {<br>                    res = ast_channel_tech(chan)->write_video(chan, fr);<br>               } else {<br>@@ -5063,7 +5067,11 @@<br>              break;<br>        case AST_FRAME_MODEM:<br>                 if (ast_channel_tech(chan)->write_stream) {<br>-                       res = ast_channel_tech(chan)->write_stream(chan, ast_stream_get_position(stream), fr);<br>+                    if (stream) {<br>+                                res = ast_channel_tech(chan)->write_stream(chan, ast_stream_get_position(stream), fr);<br>+                    } else {<br>+                             res = 0;<br>+                     }<br>             } else if ((stream == default_stream) && ast_channel_tech(chan)->write) {<br>                  res = ast_channel_tech(chan)->write(chan, fr);<br>             } else {<br>@@ -5251,7 +5259,11 @@<br>                      f = NULL;<br>             } else {<br>                      if (ast_channel_tech(chan)->write_stream) {<br>-                               res = ast_channel_tech(chan)->write_stream(chan, ast_stream_get_position(stream), f);<br>+                             if (stream) {<br>+                                        res = ast_channel_tech(chan)->write_stream(chan, ast_stream_get_position(stream), f);<br>+                             } else {<br>+                                     res = 0;<br>+                             }<br>                     } else if ((stream == default_stream) && ast_channel_tech(chan)->write) {<br>                          res = ast_channel_tech(chan)->write(chan, f);<br>                      } else {<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6963">change 6963</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6963"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Icf84ca982a67cdd6e9a71851eb7eb1bd0e865276 </div>
<div style="display:none"> Gerrit-Change-Number: 6963 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Matthew Fredrickson <creslin@digium.com> </div>