]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[core] scan-build: Access to field 'microseconds_per_packet' results in a dereference... 278/head
authorDragos Oancea <dragos@signalwire.com>
Thu, 30 Jan 2020 22:02:16 +0000 (22:02 +0000)
committerDragos Oancea <dragos@signalwire.com>
Fri, 31 Jan 2020 18:49:33 +0000 (18:49 +0000)
src/switch_loadable_module.c

index 85ab3991e81c65fc902b3f180fc3cc2b122e0fe0..ca761c22df16deaf31b3870b38c8dd63ba0488fa 100644 (file)
@@ -2678,7 +2678,13 @@ static void switch_loadable_module_sort_codecs(const switch_codec_implementation
 #endif
 
        for (i = 0; i < arraylen; i++) {
-               int this_ptime = array[i]->microseconds_per_packet / 1000;
+               int this_ptime;
+
+               if (!array[i]) {
+                       continue;
+               }
+
+               this_ptime = array[i]->microseconds_per_packet / 1000;
 
                if (!strcasecmp(array[i]->iananame, "ilbc")) {
                        this_ptime = 20;