<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 style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi,</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We've encountered an issue whereby following the addition of reconfigure in v4.1, it seems that segfaults may occur randomly when performing reconfigure. The issue seems to be caused by uninitialized variables during copying the paramters in the reconfigure.
We have debugged the issue and come up with the a patch to fix it. The patch is included at the end of this message.</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The issue is that the values of `dst->filmGrain` and `dst-aomFilmGrain` may be uninitialized in `x265_copy_params` if the respective values in `src` are null. When the `src` values are null, no value is assigned the destination leading to uninitialized pointers
which may be used later. To fix this, we have taken two steps; firstly we removed the check on the `src` value as this was not adding any value as the pointers are being copied by value rather than being dereferenced. This ensures that even if the `src` values
are null, the `dst` values are not left uninitialized. Secondly, we have made sure that the destination is already zero initialized before the copy in `x265_encoder_reconfig`. This seems to be the only location that uses a stack variable, all others appear
to be heap allocated with zero memory.</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Please let me know if there's anything else I can do to help.</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks,</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Rob</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
diff --git a/source/common/param.cpp b/source/common/param.cpp</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
index a35b06339..7eea045d2 100755</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
--- a/source/common/param.cpp</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
+++ b/source/common/param.cpp</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
@@ -3017,11 +3017,9 @@ void x265_copy_params(x265_param* dst, x265_param* src)</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
memcpy(dst->svtHevcParam, src->svtHevcParam, sizeof(EB_H265_ENC_CONFIGURATION));</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
#endif</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
/* Film grain */</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- if (src->filmGrain)</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- dst->filmGrain = src->filmGrain;</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
+ dst->filmGrain = src->filmGrain;</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
/* Aom Film grain*/</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- if (src->aomFilmGrain)</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- dst->aomFilmGrain = src->aomFilmGrain;</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
+ dst->aomFilmGrain = src->aomFilmGrain;</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
dst->bEnableSBRC = src->bEnableSBRC;</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
dst->bConfigRCFrame = src->bConfigRCFrame;</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
dst->isAbrLadderEnable = src->isAbrLadderEnable;</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
diff --git a/source/encoder/api.cpp b/source/encoder/api.cpp</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
index e89f0cf8d..0a06c6eb3 100644</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
--- a/source/encoder/api.cpp</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
+++ b/source/encoder/api.cpp</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
@@ -309,7 +309,7 @@ int x265_encoder_reconfig(x265_encoder* enc, x265_param* param_in)</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
{</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
if (!enc || !param_in)</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
return -1;</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
- x265_param save;</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
+ x265_param save = {};</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Encoder* encoder = static_cast<Encoder*>(enc);</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
if (strlen(encoder->m_param->csvfn) && param_in->csvfpt != NULL)</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
encoder->m_param->csvfpt = param_in->csvfpt;</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
<br>
</div>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: ARIAL" align="justify"><span style="FONT-FAMILY: Calibri"><span style="FONT-FAMILY: "></span></span>
</p><table style="HEIGHT: 257px; WIDTH: 820px">
<tbody>
<tr>
<td style="FONT-SIZE: 10pt; HEIGHT: 37px; FONT-FAMILY: Arial; WIDTH: 160px" valign="top" rowspan="2" align="center">
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial" align="center"><span style="FONT-SIZE: 8pt"><a title="" href="http://www.v-nova.com/"><img style="HEIGHT: 130px; WIDTH: 120px" border="0" src="cid:thumbnail_bfa8ec31-1546-45d1-990c-0de39ea526e7.jfif" width="120" height="130"></a><a title="" href="https://www.v-nova.com/perseus-video-compression-technology/#whatis"></a></span></p><span style="FONT-FAMILY: Arial"></span></td>
<td style="FONT-SIZE: 10pt; HEIGHT: 25px; FONT-FAMILY: Arial; WIDTH: 500px" valign="top">
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial" align="left"><span style="FONT-FAMILY: Calibri"><span style="FONT-SIZE: 11pt"><font size="2"><strong><span style="FONT-SIZE: 12pt">Rob Arrow</span><br style="FONT-SIZE: 11pt"></strong><span style="FONT-SIZE: 11pt">Software Engineer<br style="FONT-SIZE: 11pt">T:
+44 203 481 4300 <br style="FONT-SIZE: 11pt"> <span style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri"></span><span style="FONT-FAMILY: Calibri"></span><span style="FONT-SIZE: 11pt"></span><span style="FONT-FAMILY: Calibri"></span><span style="FONT-SIZE: 11pt"></span></span></font></span></span></p></td></tr>
<tr>
<td style="FONT-SIZE: 10pt; HEIGHT: 25px; FONT-FAMILY: Arial; WIDTH: 660px" valign="top">
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span style="FONT-FAMILY: Calibri"><span style="FONT-FAMILY: "><font color="#828282">20 Eastbourne Terrace <br></font></span></span><span style="FONT-FAMILY: Calibri"><span style="FONT-FAMILY: "><font color="#828282">London W2 6LG</font></span></span><span style="FONT-FAMILY: Calibri"><span style="FONT-FAMILY: "><br><a href="http://www.v-nova.com">www.v-nova.com<span style="FONT-FAMILY: Calibri"></span></a> <br><br></span></span><span style="FONT-FAMILY: Calibri"><span style="FONT-FAMILY: "><span style="FONT-FAMILY: Calibri"><a class="socialLink" href="https://www.linkedin.com/company/2760764/admin/"><img class="socialLink" border="0" src="cid:adrianaslinkedin_1ea25bda-8391-4a31-8dce-d6ca3ce29f1f.png"></a> <a title="" class="socialLink" href="https://twitter.com/VNovaVideo"><img class="socialLink" border="0" src="cid:AdrianaTwitter_5893815c-bebb-47eb-adf5-461be8d5de73.png"></a></span></span></span></p></td></tr></tbody></table>
<p style="FONT-SIZE: 10pt; MARGIN-BOTTOM: 5pt; FONT-FAMILY: Arial; MARGIN-TOP: 0px"></p>
<P style="FONT-SIZE: 10pt; FONT-FAMILY: ARIAL"><SPAN
style='FONT-SIZE: 8pt; FONT-FAMILY: "Arial",sans-serif; COLOR: rgb(166,166,166)'>This
email and any attachments are sent in strictest confidence for the sole use of
the addressee and may contain legally privileged, confidential, proprietary and
personal data. If you are not the intended recipient, please advise the sender
by replying promptly to this email and then delete and destroy this email and
any attachments without any further use, copying or forwarding. <BR><BR>For more
information on how we use and protect your information, please review our
Privacy Policy <A
href="https://www.v-nova.com/privacy-policy/">here</A></SPAN><SPAN
style='FONT-SIZE: 8pt; FONT-FAMILY: "Arial",sans-serif; COLOR: rgb(166,166,166)'><BR> <BR></SPAN><SPAN
style='FONT-SIZE: 8pt; FONT-FAMILY: "Arial",sans-serif; COLOR: rgb(0,57,115)'>Please
consider your environmental responsibility before printing this
e-mail</SPAN></P></body>
</html>