FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for mod_spandsp
This commit is contained in:
parent
2bf545a18b
commit
c952a025dd
|
@ -282,6 +282,8 @@ SWITCH_STANDARD_API(start_tone_detect_api)
|
||||||
|
|
||||||
puuid = strdup((char *)cmd);
|
puuid = strdup((char *)cmd);
|
||||||
|
|
||||||
|
switch_assert(puuid);
|
||||||
|
|
||||||
if ((descriptor = strchr(puuid, ' '))) {
|
if ((descriptor = strchr(puuid, ' '))) {
|
||||||
*descriptor++ = '\0';
|
*descriptor++ = '\0';
|
||||||
}
|
}
|
||||||
|
@ -367,7 +369,7 @@ SWITCH_STANDARD_API(start_tdd_detect_api)
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
spandsp_tdd_decode_session(psession);
|
status = spandsp_tdd_decode_session(psession);
|
||||||
|
|
||||||
if (status == SWITCH_STATUS_SUCCESS) {
|
if (status == SWITCH_STATUS_SUCCESS) {
|
||||||
stream->write_function(stream, "+OK started\n");
|
stream->write_function(stream, "+OK started\n");
|
||||||
|
@ -413,6 +415,8 @@ SWITCH_STANDARD_API(start_send_tdd_api)
|
||||||
|
|
||||||
puuid = strdup((char *)cmd);
|
puuid = strdup((char *)cmd);
|
||||||
|
|
||||||
|
switch_assert(puuid);
|
||||||
|
|
||||||
if ((text = strchr(puuid, ' '))) {
|
if ((text = strchr(puuid, ' '))) {
|
||||||
*text++ = '\0';
|
*text++ = '\0';
|
||||||
}
|
}
|
||||||
|
|
|
@ -463,7 +463,7 @@ static switch_status_t switch_g726_init(switch_codec_t *codec, switch_codec_flag
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flags & SWITCH_CODEC_FLAG_AAL2 || strstr(codec->implementation->iananame, "AAL2"))) {
|
if (flags & SWITCH_CODEC_FLAG_AAL2 || strstr(codec->implementation->iananame, "AAL2")) {
|
||||||
packing = G726_PACKING_LEFT;
|
packing = G726_PACKING_LEFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -824,9 +824,7 @@ static switch_status_t spanfax_init(pvt_t *pvt, transport_mode_t trans_mode)
|
||||||
|
|
||||||
/* add to timer thread processing */
|
/* add to timer thread processing */
|
||||||
if (!add_pvt(pvt)) {
|
if (!add_pvt(pvt)) {
|
||||||
if (channel) {
|
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
span_log_set_message_handler(t38_terminal_get_logging_state(t38), mod_spandsp_log_message, pvt->session);
|
span_log_set_message_handler(t38_terminal_get_logging_state(t38), mod_spandsp_log_message, pvt->session);
|
||||||
|
@ -1027,12 +1025,17 @@ static switch_status_t spanfax_destroy(pvt_t *pvt)
|
||||||
|
|
||||||
static t38_mode_t configure_t38(pvt_t *pvt)
|
static t38_mode_t configure_t38(pvt_t *pvt)
|
||||||
{
|
{
|
||||||
switch_core_session_t *session = pvt->session;
|
switch_core_session_t *session;
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel;
|
||||||
switch_t38_options_t *t38_options = switch_channel_get_private(channel, "t38_options");
|
switch_t38_options_t *t38_options;
|
||||||
int method = 2;
|
int method = 2;
|
||||||
|
|
||||||
if (!t38_options || !pvt || !pvt->t38_core) {
|
switch_assert(pvt && pvt->session);
|
||||||
|
session = pvt->session;
|
||||||
|
channel = switch_core_session_get_channel(session);
|
||||||
|
t38_options = switch_channel_get_private(channel, "t38_options");
|
||||||
|
|
||||||
|
if (!t38_options || !pvt->t38_core) {
|
||||||
pvt->t38_mode = T38_MODE_REFUSED;
|
pvt->t38_mode = T38_MODE_REFUSED;
|
||||||
return pvt->t38_mode;
|
return pvt->t38_mode;
|
||||||
}
|
}
|
||||||
|
@ -2364,7 +2367,7 @@ switch_status_t spandsp_fax_detect_session(switch_core_session_t *session,
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cont && !(cont = switch_core_session_alloc(session, sizeof(*cont)))) {
|
if (!(cont = switch_core_session_alloc(session, sizeof(*cont)))) {
|
||||||
return SWITCH_STATUS_MEMERR;
|
return SWITCH_STATUS_MEMERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -744,8 +744,6 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
|
||||||
case SWITCH_MESSAGE_INDICATE_RINGING:
|
case SWITCH_MESSAGE_INDICATE_RINGING:
|
||||||
break;
|
break;
|
||||||
case SWITCH_MESSAGE_INDICATE_BRIDGE:
|
case SWITCH_MESSAGE_INDICATE_BRIDGE:
|
||||||
mod_spandsp_indicate_data(session, SWITCH_FALSE, SWITCH_TRUE);
|
|
||||||
break;
|
|
||||||
case SWITCH_MESSAGE_INDICATE_UNBRIDGE:
|
case SWITCH_MESSAGE_INDICATE_UNBRIDGE:
|
||||||
mod_spandsp_indicate_data(session, SWITCH_FALSE, SWITCH_TRUE);
|
mod_spandsp_indicate_data(session, SWITCH_FALSE, SWITCH_TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -363,7 +363,7 @@ int udptl_rx_packet(udptl_state_t *s, const uint8_t buf[], int len)
|
||||||
|
|
||||||
int udptl_build_packet(udptl_state_t *s, uint8_t buf[], const uint8_t msg[], int msg_len)
|
int udptl_build_packet(udptl_state_t *s, uint8_t buf[], const uint8_t msg[], int msg_len)
|
||||||
{
|
{
|
||||||
uint8_t fec[LOCAL_FAX_MAX_DATAGRAM];
|
uint8_t fec[LOCAL_FAX_MAX_DATAGRAM] = { 0 };
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
int seq;
|
int seq;
|
||||||
|
|
Loading…
Reference in New Issue