<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16259">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">format_ogg_speex: Implement a "not supported" write handler<br><br>This format did not specify a "write" handler, so when attempting to write<br>to it (ast_writestream) a crash would occur.<br><br>This patch adds a default handler that simply issues a "not supported"<br>warning, thus no longer crashing.<br><br>ASTERISK-29539<br><br>Change-Id: I8f6ddc7cc3b15da30803be3b1cf68e2ba0fbce91<br>---<br>M formats/format_ogg_speex.c<br>1 file changed, 9 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/formats/format_ogg_speex.c b/formats/format_ogg_speex.c</span><br><span>index ff26c9d..0d7a8fd 100644</span><br><span>--- a/formats/format_ogg_speex.c</span><br><span>+++ b/formats/format_ogg_speex.c</span><br><span>@@ -254,6 +254,12 @@</span><br><span> return -1;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static int ogg_speex_write(struct ast_filestream *s, struct ast_frame *f)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_log(LOG_WARNING, "Writing is not supported on OGG/Speex streams!\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ return -1;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /*!</span><br><span> * \brief Seek to a specific position in an OGG/Speex filestream.</span><br><span> * \param s The filestream to truncate.</span><br><span>@@ -277,6 +283,7 @@</span><br><span> .name = "ogg_speex",</span><br><span> .exts = "spx",</span><br><span> .open = ogg_speex_open,</span><br><span style="color: hsl(120, 100%, 40%);">+ .write = ogg_speex_write,</span><br><span> .seek = ogg_speex_seek,</span><br><span> .trunc = ogg_speex_trunc,</span><br><span> .tell = ogg_speex_tell,</span><br><span>@@ -290,6 +297,7 @@</span><br><span> .name = "ogg_speex16",</span><br><span> .exts = "spx16",</span><br><span> .open = ogg_speex_open,</span><br><span style="color: hsl(120, 100%, 40%);">+ .write = ogg_speex_write,</span><br><span> .seek = ogg_speex_seek,</span><br><span> .trunc = ogg_speex_trunc,</span><br><span> .tell = ogg_speex_tell,</span><br><span>@@ -303,6 +311,7 @@</span><br><span> .name = "ogg_speex32",</span><br><span> .exts = "spx32",</span><br><span> .open = ogg_speex_open,</span><br><span style="color: hsl(120, 100%, 40%);">+ .write = ogg_speex_write,</span><br><span> .seek = ogg_speex_seek,</span><br><span> .trunc = ogg_speex_trunc,</span><br><span> .tell = ogg_speex_tell,</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16259">change 16259</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/+/16259"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: I8f6ddc7cc3b15da30803be3b1cf68e2ba0fbce91 </div>
<div style="display:none"> Gerrit-Change-Number: 16259 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>