<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14695">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_session: Ensure reused streams have correct bundle group<br><br>When a bundled stream is removed, its bundle_group is reset to -1.<br>If that stream is later reused, the bundle_group needs to be reset<br>to 0 or it could mistakenly be rebundled with a stream that was<br>removed and never reused. Since the removed stream has no rtp<br>instance, a crash will result.<br><br>Change-Id: Ie2b792220f9291587ab5f9fd123145559dba96d7<br>---<br>M res/res_pjsip_session.c<br>1 file changed, 7 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/95/14695/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c</span><br><span>index d05f2c5..b0de0fe 100644</span><br><span>--- a/res/res_pjsip_session.c</span><br><span>+++ b/res/res_pjsip_session.c</span><br><span>@@ -486,6 +486,13 @@</span><br><span> /* A stream can never exist without an accompanying media session */</span><br><span> if (session_media->type == type) {</span><br><span> ao2_ref(session_media, +1);</span><br><span style="color: hsl(120, 100%, 40%);">+ /*</span><br><span style="color: hsl(120, 100%, 40%);">+ * If this session_media was previously removed, its bundle group was probably reset</span><br><span style="color: hsl(120, 100%, 40%);">+ * to -1. We need to reset it to 0 if bundling is enabled.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+ if (session->endpoint->media.bundle && session_media->bundle_group == -1) {</span><br><span style="color: hsl(120, 100%, 40%);">+ session_media->bundle_group = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> } else {</span><br><span> session_media = NULL;</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14695">change 14695</a>. To unsubscribe, or for help writing mail filters, 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/c/asterisk/+/14695"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: certified/16.8 </div>
<div style="display:none"> Gerrit-Change-Id: Ie2b792220f9291587ab5f9fd123145559dba96d7 </div>
<div style="display:none"> Gerrit-Change-Number: 14695 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>