]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9687: segfault Program terminated with signal SIGFPE, Arithmetic exception.
authorBrian West <brian@freeswitch.org>
Tue, 1 Nov 2016 21:50:18 +0000 (16:50 -0500)
committerBrian West <brian@freeswitch.org>
Tue, 1 Nov 2016 21:50:18 +0000 (16:50 -0500)
src/mod/codecs/mod_opus/mod_opus.c

index 8d42c2477ef9e24c0114adadeea270a9095d7efa..de19d6cd06ab9e370f54b4f416923f4125a290bf 100644 (file)
@@ -702,7 +702,7 @@ static switch_status_t switch_opus_destroy(switch_codec_t *codec)
                        int avg_encoded_bitrate = 0;
                        if (session) {
 
-                               if (context->encoder_stats.frame_counter > 0) {
+                               if (context->encoder_stats.frame_counter > 0 && context->encoder_stats.encoded_bytes > 0 && context->encoder_stats.encoded_msec > 0) {
                                        avg_encoded_bitrate = (context->encoder_stats.encoded_bytes * 8) / (context->encoder_stats.encoded_msec / 1000);
                                }