[asterisk-dev] ASTERISK-26978 - rtp: Crash in ast_rtp_codecs_payload_code()

Joshua Colp jcolp at digium.com
Wed May 24 09:26:28 CDT 2017


On Wed, May 24, 2017, at 11:13 AM, Ross Beer wrote:

<snip>

> 
> Therefore I have added the following code to check for this:
> 
> 
>         if (format1->codec == NULL || format2->codec == NULL) {
> return AST_FORMAT_CMP_NOT_EQUAL;
> }
> 
> The question is, should 'codec' be NULL if 'format1' and 'format2' are
> not NULL? Is adding the above check, the correct fix?

A format can't be created and remain valid without a codec being present
on it. A format itself is a codec + extra data about it. Identifying how
it became NULL and why the format is no longer valid would uncover the
real fix.

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list