<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p><span style="font-size: 10pt;">>> </span><br>
</p>
<div style="color: rgb(0, 0, 0);"><font size="2"><span style="font-size:10pt;">
<div class="PlainText">>> Therefore I have added the following code to check for this:<br>
>> <br>
>> <br>
>> if (format1->codec == NULL || format2->codec == NULL) {<br>
>> return AST_FORMAT_CMP_NOT_EQUAL;<br>
>> }<br>
>> <br>
>> The question is, should 'codec' be NULL if 'format1' and 'format2' are<br>
.> not NULL? Is adding the above check, the correct fix?<br>
<br>
>A format can't be created and remain valid without a codec being present<br>
>on it. A format itself is a codec + extra data about it. Identifying how<br>
>it became NULL and why the format is no longer valid would uncover the<br>
>real fix.</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">Does the format object need locking so that anything acting on it doesn't have the object pulled from under it?</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">My theory is that a channel is attempting to unallocated the 'format' object while it is trying to be compared. It, therefore, makes it through the NULL checks on 'format1' and 'format2' but is in the process of being freed.</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">There are quite a few backtraces on this and the linked issue. Would anyone be willing to take a look, my C skills are not that good?</div>
<div class="PlainText"><br>
</div>
<div class="PlainText"><br>
</div>
<div class="PlainText"><br>
</div>
</span></font></div>
</div>
</body>
</html>