<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] Update WOFF2 decoder"
href="https://bugs.webkit.org/show_bug.cgi?id=162608#c5">Comment # 5</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] Update WOFF2 decoder"
href="https://bugs.webkit.org/show_bug.cgi?id=162608">bug 162608</a>
from <span class="vcard"><a class="email" href="mailto:khaledhosny@eglug.org" title="Khaled Hosny <khaledhosny@eglug.org>"> <span class="fn">Khaled Hosny</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=289945&action=diff" name="attach_289945" title="Patch, v2">attachment 289945</a> <a href="attachment.cgi?id=289945&action=edit" title="Patch, v2">[details]</a></span>
Patch, v2
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=289945&action=review">https://bugs.webkit.org/attachment.cgi?id=289945&action=review</a>
<span class="quote">>> Source/WebCore/platform/graphics/WOFFFileFormat.cpp:103
>> + return Write(data, m_size, n);
>
> I think this should be removed.</span >
Good catch, I think it was a left over from previous trials.
<span class="quote">>> Source/WebCore/platform/graphics/WOFFFileFormat.cpp:104
>> + if (!m_vector.tryReserveCapacity(m_size + n))
>
> Is it needed? It seems that WTF::Vector::append already calls expandCapacity.</span >
I’m not sure what is going on, but if I don’t do that decoding will always fail.
<span class="quote">>> Source/WebCore/platform/graphics/WOFFFileFormat.cpp:116
>> + m_vector.insert(offset, static_cast<const char*>(data), n);
>
> I wonder if it's possible to copy the data in one step.</span >
I’m not sure if Vector has an API to do that, I didn’t seem to find any.
<span class="quote">>> Source/WebCore/platform/graphics/WOFFFileFormat.cpp:128
>> + size_t m_size;
>
> Do you really need this member? It seems that you can just use m_vector::size()</span >
I removed it.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>