[mod_amr] scan-build: Array access (from variable 'tocs') results in a null pointer dereference - switch_amr_unpack_oa()

This commit is contained in:
Dragos Oancea 2020-02-25 17:51:09 +00:00
parent 42d3100609
commit 0c2873e726
1 changed files with 3 additions and 0 deletions

View File

@ -150,6 +150,9 @@ static switch_bool_t switch_amr_unpack_oa(unsigned char *buf, uint8_t *tmp, int
int index;
int framesz;
if (!buf) {
return SWITCH_FALSE;
}
buf++; /* CMR skip */
tocs = buf;
index = ((tocs[0]>>3) & 0xf);