<p>Benjamin Keith Ford has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6464">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">main/format_cap.c: Fix crash with video.<br><br>When an endpoint without video capabilities is called by another<br>endpoint with video capabilities, or if both endpoints joined a<br>confbridge with video_mode=sfu, Asterisk will core dump. This is<br>due to a NULL value being passed into ast_format_cap_get_compatible<br>for the first argument, which is then referenced without a NULL<br>check. This change adds the NULL check, eliminating the crash.<br><br>Also removed a stray semicolon in the bridging code.<br><br>Change-Id: Ic86f8b65a4a26a60885b28b8b1a0b22e1b471d42<br>---<br>M main/bridge.c<br>M main/format_cap.c<br>2 files changed, 5 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/64/6464/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/bridge.c b/main/bridge.c<br>index ab12ecf..5d9c0c1 100644<br>--- a/main/bridge.c<br>+++ b/main/bridge.c<br>@@ -1741,7 +1741,7 @@<br> <br>       ao2_ref(bridge_channel, -1);<br> <br>-join_exit:;<br>+join_exit:<br>    ast_bridge_run_after_callback(chan);<br>  bridge_channel_impart_signal(chan);<br>   if (!(ast_channel_softhangup_internal_flag(chan) & AST_SOFTHANGUP_ASYNCGOTO)<br>diff --git a/main/format_cap.c b/main/format_cap.c<br>index b0897c0..12141ad 100644<br>--- a/main/format_cap.c<br>+++ b/main/format_cap.c<br>@@ -629,6 +629,10 @@<br> {<br>       int idx, res = 0;<br> <br>+ if (!cap1) {<br>+         return -1;<br>+   }<br>+<br>  for (idx = 0; idx < AST_VECTOR_SIZE(&cap1->preference_order); ++idx) {<br>              struct format_cap_framed *framed = AST_VECTOR_GET(&cap1->preference_order, idx);<br>               struct ast_format *format;<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6464">change 6464</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/6464"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ic86f8b65a4a26a60885b28b8b1a0b22e1b471d42 </div>
<div style="display:none"> Gerrit-Change-Number: 6464 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Benjamin Keith Ford <bford@digium.com> </div>