<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmo-netif/+/18451">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">amr: fix off-by-one in osmo_amr_bwe_to_oa()<br><br>The for loop in osmo_amr_bwe_to_oa, that converts the body part of the<br>AMR payload runs one byte too far. This may cause that some of the<br>padding bits in the end are not set to zero. The loop is designed to<br>convert n-1 bytes and the nth byte is done separately at the end.<br><br>Change-Id: I91e755b83aaac722079879c026d913cc446812d1<br>---<br>M src/amr.c<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/51/18451/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/amr.c b/src/amr.c</span><br><span>index 980d6ad..2706432 100644</span><br><span>--- a/src/amr.c</span><br><span>+++ b/src/amr.c</span><br><span>@@ -198,7 +198,7 @@</span><br><span>               return -1;</span><br><span>   oa_payload_len = 2 + osmo_amr_bytes(oa_hdr->ft);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- for (i = 0; i < oa_payload_len - 2; i++) {</span><br><span style="color: hsl(120, 100%, 40%);">+ for (i = 0; i < oa_payload_len - 3; i++) {</span><br><span>                buf[i + 2] = payload[i + 1] << 2;</span><br><span>              buf[i + 2] |= payload[i + 2] >> 6;</span><br><span>     }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmo-netif/+/18451">change 18451</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.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.osmocom.org/c/libosmo-netif/+/18451"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-netif </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I91e755b83aaac722079879c026d913cc446812d1 </div>
<div style="display:none"> Gerrit-Change-Number: 18451 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>