<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:WebKit&#64;JeremyZerfas.com" title="Jeremy Zerfas &lt;WebKit&#64;JeremyZerfas.com&gt;"> <span class="fn">Jeremy Zerfas</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Endless loop for image with zero duration frame"
   href="https://bugs.webkit.org/show_bug.cgi?id=23684">bug 23684</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
               &nbsp;
           </td>
           <td>WebKit&#64;JeremyZerfas.com
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Endless loop for image with zero duration frame"
   href="https://bugs.webkit.org/show_bug.cgi?id=23684#c8">Comment # 8</a>
              on <a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Endless loop for image with zero duration frame"
   href="https://bugs.webkit.org/show_bug.cgi?id=23684">bug 23684</a>
              from <span class="vcard"><a class="email" href="mailto:WebKit&#64;JeremyZerfas.com" title="Jeremy Zerfas &lt;WebKit&#64;JeremyZerfas.com&gt;"> <span class="fn">Jeremy Zerfas</span></a>
</span></b>
        <pre>This ticket has been open for several years and I just thought I would point out that although this bug seems to have been valid back then, some of the relevant code has been refactored since then and there is no longer a potential for an endless loop. In the current code, if the containing loop doesn't exit the function, then on each iteration of that loop it instead increments frameAfterNextStartTime by the frameDurationAtIndex() function (which normally never returns a value less than 0.011 seconds) and eventually causes the loop to end.

I'm attaching two GIFs I created that contain zero duration frames in case anyone wants them for testing. Both GIFs contain a repeating animation that shows the numbers 1, 2, and 3 after each other. In &quot;Animated GIF with Single Zero Duration Frame.gif&quot;, the first and third frames have a one second delay but the second frame has a zero second delay. In &quot;Animated GIF with All Zero Duration Frames.gif&quot; all the frames have zero second delays.

It looks like zero duration frames are allowed by GIFs and do have some valid uses, see <a href="http://www.imagemagick.org/Usage/anim_basics/#zero">http://www.imagemagick.org/Usage/anim_basics/#zero</a> . Mozilla added some code back in late 2013 to respect those zero duration frames for non-looping GIFs but it looks like they just recently found out that the new code is causing problems with some (poorly made) GIFs on the web and will be removing that code, see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=890743">https://bugzilla.mozilla.org/show_bug.cgi?id=890743</a> .</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>