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

[#1933] Protecting pointer

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