<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 29, 2015 at 4:06 AM, Min Chen <span dir="ltr"><<a href="mailto:chenm003@163.com" target="_blank">chenm003@163.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Min Chen <<a href="mailto:chenm003@163.com">chenm003@163.com</a>><br>
# Date 1451340412 21600<br>
# Node ID f8daf6c38fec27b8b01f3a01df19c5a2252382b9<br>
# Parent 1471e4e433ccccf71f39a6eb93507c349fb8539e<br>
fix weight memory free bug on I400<br>
---<br>
source/encoder/reference.cpp | 6 +++---<br>
1 files changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff -r 1471e4e433cc -r f8daf6c38fec source/encoder/reference.cpp<br>
--- a/source/encoder/reference.cpp Tue Dec 22 19:25:58 2015 +0530<br>
+++ b/source/encoder/reference.cpp Mon Dec 28 16:06:52 2015 -0600<br>
@@ -40,9 +40,9 @@<br>
<br>
MotionReference::~MotionReference()<br>
{<br>
- X265_FREE(weightBuffer[0]);<br>
- X265_FREE(weightBuffer[1]);<br>
- X265_FREE(weightBuffer[2]);<br>
+ if (weightBuffer[0]) X265_FREE_ZERO(weightBuffer[0]);<br>
+ if (weightBuffer[1]) X265_FREE_ZERO(weightBuffer[1]);<br>
+ if (weightBuffer[2]) X265_FREE_ZERO(weightBuffer[2]);<br></blockquote><div><br>Hmm, the x265_free(ptr) already checks for this. Does not assigning ptr to NULL cause a double free?<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
}<br>
<br>
int MotionReference::init(PicYuv* recPic, WeightParam *wp, const x265_param& p)<br>
<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div>Deepthi Nandakumar<br></div>Engineering Manager, x265<br></div>Multicoreware, Inc<br></div></div>
</div></div>