<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&#64;eglug.org" title="Khaled Hosny &lt;khaledhosny&#64;eglug.org&gt;"> <span class="fn">Khaled Hosny</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=289945&amp;action=diff" name="attach_289945" title="Patch, v2">attachment 289945</a> <a href="attachment.cgi?id=289945&amp;action=edit" title="Patch, v2">[details]</a></span>
Patch, v2

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=289945&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=289945&amp;action=review</a>

<span class="quote">&gt;&gt; Source/WebCore/platform/graphics/WOFFFileFormat.cpp:103
&gt;&gt; +        return Write(data, m_size, n);
&gt; 
&gt; I think this should be removed.</span >

Good catch, I think it was a left over from previous trials.

<span class="quote">&gt;&gt; Source/WebCore/platform/graphics/WOFFFileFormat.cpp:104
&gt;&gt; +        if (!m_vector.tryReserveCapacity(m_size + n))
&gt; 
&gt; 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">&gt;&gt; Source/WebCore/platform/graphics/WOFFFileFormat.cpp:116
&gt;&gt; +        m_vector.insert(offset, static_cast&lt;const char*&gt;(data), n);
&gt; 
&gt; 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">&gt;&gt; Source/WebCore/platform/graphics/WOFFFileFormat.cpp:128
&gt;&gt; +    size_t m_size;
&gt; 
&gt; 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>