<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - REGRESSION(r208511): ImageDecoders: Crash decoding GIF images since r208511"
   href="https://bugs.webkit.org/show_bug.cgi?id=164864#c10">Comment # 10</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - REGRESSION(r208511): ImageDecoders: Crash decoding GIF images since r208511"
   href="https://bugs.webkit.org/show_bug.cgi?id=164864">bug 164864</a>
              from <span class="vcard"><a class="email" href="mailto:sabouhallawa&#64;apple.com" title="Said Abou-Hallawa &lt;sabouhallawa&#64;apple.com&gt;"> <span class="fn">Said Abou-Hallawa</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=164864#c8">comment #8</a>)
<span class="quote">&gt; (In reply to <a href="show_bug.cgi?id=164864#c6">comment #6</a>)
&gt; &gt; Comment on <span class=""><a href="attachment.cgi?id=295048&amp;action=diff" name="attach_295048" title="Patch">attachment 295048</a> <a href="attachment.cgi?id=295048&amp;action=edit" title="Patch">[details]</a></span>
&gt; &gt; Patch
&gt; &gt; 
&gt; &gt; View in context:
&gt; &gt; <a href="https://bugs.webkit.org/attachment.cgi?id=295048&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=295048&amp;action=review</a>
&gt; &gt; 
&gt; &gt; Would it be better to rename the existing virtual frameBufferAtIndex()
&gt; &gt; functions to be internalFrameBufferAtIndex() and create a non virtual
&gt; &gt; function called frameBufferAtIndex() in imageDecoder class which does the
&gt; &gt; locking and call internalFrameBufferAtIndex()?
&gt; 
&gt; I thought about that but I also want to make sure the returned ImageFrame is
&gt; not modified by another thread, that's why don't release the lock until the
&gt; end of the function.
&gt; </span >

But the only function that changes the ImageFrame or the ImageDecoder:: m_frameBufferCache is ImageDecoder::frameBufferAtIndex(). It does that via calling ImageDecoder::decode() which calls ImageReader::decode(). The ImageReader::decode() is the one that is responsible for caching the ImageFrames in ImageDecoder:: m_frameBufferCache.

There is another calls to ImageDecoder::decode() from ImageDecoder::isSizeAvailable() but this calls decodes the size of the image frame only. It does not cache any ImageFrame.

So I think it's cleaner to lock m_frameBufferCache for writing in the one place that changes it instead of locking every place that makes a call to the same function.</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>