Skip to content
Snippets Groups Projects
Commit 09cff061 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

[#1933] Protecting pointer

parent 795e6c03
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,7 @@ gchar* call_get_peer_name (const gchar *format)
if (!end) {
return g_strndup (format, 0);
} else {
name = g_strdup (format);
name = format;
return g_strndup(name, end - name);
}
}
......
......@@ -38,6 +38,7 @@ void create_new_conference (conference_state_t state, const gchar* confID, confe
{
conference_obj_t *obj;
gchar* conf_id;
// Allocate memory
obj = g_new0 (conference_obj_t, 1);
......@@ -46,7 +47,8 @@ void create_new_conference (conference_state_t state, const gchar* confID, confe
obj->_state = state;
// Set the ID field
obj->_confID = g_strdup (confID);
conf_id = confID;
obj->_confID = g_strdup (conf_id);
*new_conf = obj;
}
......
......@@ -882,12 +882,8 @@ IAXVoIPLink::iaxHandleVoiceEvent (iax_event* event, IAXCall* call)
int expandedSize, nbSample_;
AudioCodec *ac;
ac = call->getCodecMap().getCodec (call -> getAudioCodec());
audiolayer->getMainBuffer()->setInternalSamplingRate(ac->getClockRate());
// If we receive datalen == 0, some things of the jitter buffer in libiax2/iax.c
// were triggered
if (!call)
return;
if (!event->datalen) {
// Skip this empty packet.
......@@ -895,8 +891,18 @@ IAXVoIPLink::iaxHandleVoiceEvent (iax_event* event, IAXCall* call)
return;
}
ac = call->getCodecMap ().getCodec (call->getAudioCodec ());
if (!ac)
return;
if (audiolayer) {
audiolayer->getMainBuffer ()->setInternalSamplingRate (ac->getClockRate ());
// If we receive datalen == 0, some things of the jitter buffer in libiax2/iax.c
// were triggered
int _mainBufferSampleRate = audiolayer->getMainBuffer()->getInternalSamplingRate();
// On-the-fly codec changing (normally, when we receive a full packet)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment