]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11014 FS-11404 fix libfvad might be enabled unexpectedly when set_mode is called
authorSeven Du <dujinfang@gmail.com>
Sat, 22 Sep 2018 08:51:39 +0000 (16:51 +0800)
committerMike Jerris <mike@jerris.com>
Mon, 24 Sep 2018 17:38:50 +0000 (17:38 +0000)
src/switch_vad.c

index 5488898cd4629488b2d980aaa97484c2e485ecd1..0e0e7f09616a0f357522455f2b0af1fe912257ed 100644 (file)
@@ -95,8 +95,9 @@ SWITCH_DECLARE(int) switch_vad_set_mode(switch_vad_t *vad, int mode)
 #ifdef SWITCH_HAVE_FVAD
        int ret = 0;
 
-       if (mode < 0 && vad->fvad) {
-               fvad_free(vad->fvad);
+       if (mode < 0) {
+               if (vad->fvad) fvad_free(vad->fvad);
+
                vad->fvad = NULL;
                return ret;
        } else if (mode > 3) {