Merge pull request #278 from dragos-oancea/switch_loadable_module_nullptr

[core] scan-build: Access to field 'microseconds_per_packet' results in a dereference of a null pointer
This commit is contained in:
Andrey Volk 2020-02-01 01:43:11 +04:00 committed by GitHub
commit fc13e7d783
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View 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;