mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 12:40:17 +00:00
FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for mod_shout
This commit is contained in:
parent
a8861e1cba
commit
daafd039ed
@ -1249,6 +1249,7 @@ void do_telecast(switch_stream_handle_t *stream)
|
|||||||
switch_core_session_t *tsession;
|
switch_core_session_t *tsession;
|
||||||
char *fname = "stream.mp3";
|
char *fname = "stream.mp3";
|
||||||
|
|
||||||
|
switch_assert(uuid);
|
||||||
if ((fname = strchr(uuid, '/'))) {
|
if ((fname = strchr(uuid, '/'))) {
|
||||||
*fname++ = '\0';
|
*fname++ = '\0';
|
||||||
}
|
}
|
||||||
@ -1309,13 +1310,13 @@ void do_telecast(switch_stream_handle_t *stream)
|
|||||||
switch_buffer_lock(buffer);
|
switch_buffer_lock(buffer);
|
||||||
bytes = switch_buffer_read(buffer, buf, sizeof(buf));
|
bytes = switch_buffer_read(buffer, buf, sizeof(buf));
|
||||||
switch_buffer_unlock(buffer);
|
switch_buffer_unlock(buffer);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
if (!bytes) {
|
if (!bytes) {
|
||||||
switch_cond_next();
|
switch_cond_next();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
memset(buf, 0, bytes);
|
memset(buf, 0, bytes);
|
||||||
}
|
|
||||||
|
|
||||||
if ((rlen = lame_encode_buffer(gfp, (void *) buf, NULL, (int)(bytes / 2), mp3buf, sizeof(mp3buf))) < 0) {
|
if ((rlen = lame_encode_buffer(gfp, (void *) buf, NULL, (int)(bytes / 2), mp3buf, sizeof(mp3buf))) < 0) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "MP3 encode error %d!\n", rlen);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "MP3 encode error %d!\n", rlen);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user