From 21f9c47dd58bffaee4b5c75ff9ee43280067f2da Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 12 Jul 2019 20:40:35 +0400 Subject: [PATCH] FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for switch_core_io.c --- src/switch_core_io.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/switch_core_io.c b/src/switch_core_io.c index 7560465187..8b12efaffb 100644 --- a/src/switch_core_io.c +++ b/src/switch_core_io.c @@ -669,7 +669,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi continue; } - if (ok && switch_test_flag(bp, SMBF_READ_REPLACE)) { + if (switch_test_flag(bp, SMBF_READ_REPLACE)) { do_bugs = 0; if (bp->callback) { bp->read_replace_frame_in = read_frame; @@ -720,7 +720,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi continue; } - if (ok && bp->ready && switch_test_flag(bp, SMBF_READ_STREAM)) { + if (bp->ready && switch_test_flag(bp, SMBF_READ_STREAM)) { switch_mutex_lock(bp->read_mutex); if (bp->read_demux_frame) { uint8_t data[SWITCH_RECOMMENDED_BUFFER_SIZE]; @@ -755,7 +755,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi } } - if (do_bugs || tap_only) { + if (do_bugs) { goto done; } @@ -985,12 +985,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_recv_dtmf(switch_core_sessio return SWITCH_STATUS_FALSE; } + switch_assert(dtmf); + if (switch_test_flag(dtmf, DTMF_FLAG_SENSITIVE)) { return SWITCH_STATUS_SUCCESS; } - switch_assert(dtmf); - new_dtmf = *dtmf; if (new_dtmf.duration > switch_core_max_dtmf_duration(0)) {