<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>15971</bug_id>
          
          <creation_ts>2007-11-13 11:57:37 -0800</creation_ts>
          <short_desc>Public GIF image decoder erroneously fails if no new data has come in</short_desc>
          <delta_ts>2007-11-19 04:23:04 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Images</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Peter Kasting">pkasting</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>61106</commentid>
    <comment_count>0</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2007-11-13 11:57:37 -0800</bug_when>
    <thetext>GIFImageReader.cpp (not used by Safari, but used by the Cairo/Qt ports) erroneously marks GIF decoding as having failed if we ask it to decode when no new data has come in since the last request to decode.  Instead, this should just result in doing nothing.

This looks like an artifact of the process of porting from the Mozilla codebase.  I think in Mozilla&apos;s codebase, this function is never called unless new data has come in, whereas in WebKit, the wrapper code does not guarantee that.  Therefore, I could fix this by putting a check in the wrapper that doesn&apos;t try to decode when there isn&apos;t new data.  But I think making the underlying decoder fail in this case is wrong, since there&apos;s nothing dangerous about such a call (in fact, if the check in the decoder is removed entirely, we&apos;d run all the way through the function without doing anything, and return successfully).  So instead I&apos;m planning to fix this by just changing the &quot;return false&quot; to &quot;return true&quot; in the beginning of GIFImageReader.cpp:read().

Patch coming in a bit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61116</commentid>
    <comment_count>1</comment_count>
      <attachid>17240</attachid>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2007-11-13 14:10:08 -0800</bug_when>
    <thetext>Created attachment 17240
patch v1

Simple fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61170</commentid>
    <comment_count>2</comment_count>
    <who name="Alp Toker">alp</who>
    <bug_when>2007-11-13 22:17:28 -0800</bug_when>
    <thetext>I&apos;m curious, how did you notice this? Is there a test case for this issue? A link to some online content will do..

We are getting crashes and corruption with the GIF image loader in the GTK+ port, particularly with animated GIFs, but I don&apos;t notice this patch fixing that problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61266</commentid>
    <comment_count>3</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2007-11-14 23:05:43 -0800</bug_when>
    <thetext>I was able to repro this pretty consistently with http://transit.511.org/providers/maps/SF_7122007102947.gif (a 3201x2840 GIF).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61439</commentid>
    <comment_count>4</comment_count>
      <attachid>17240</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2007-11-16 20:17:27 -0800</bug_when>
    <thetext>Comment on attachment 17240
patch v1

Looks fine, r=me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61659</commentid>
    <comment_count>5</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-11-19 04:23:04 -0800</bug_when>
    <thetext>Landed in r27897.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>17240</attachid>
            <date>2007-11-13 14:10:08 -0800</date>
            <delta_ts>2007-11-16 20:17:27 -0800</delta_ts>
            <desc>patch v1</desc>
            <filename>patch</filename>
            <type>text/plain</type>
            <size>1325</size>
            <attacher name="Peter Kasting">pkasting</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiAyNzc2MCkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTQgQEAKKzIwMDctMTEtMTMgIFBldGVyIEthc3RpbmcgIDx6ZXJvZHB4QGdtYWls
LmNvbT4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBo
dHRwOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xNTk3MQorICAgICAgICBUaGUg
R0lGIGRlY29kZXIgc2hvdWxkIG5vdCBmYWlsIGRlY29kaW5nIGlmIHRoZSBjYWxsZXIgYXNrcyBp
dCB0bworICAgICAgICBkZWNvZGUgYWdhaW4gd2hlbiBubyBuZXcgZGF0YSBoYXMgYXJyaXZlZCBz
aW5jZSB0aGUgbGFzdCBjYWxsLgorCisgICAgICAgICogcGxhdGZvcm0vaW1hZ2UtZGVjb2RlcnMv
Z2lmL0dJRkltYWdlUmVhZGVyLmNwcDoKKyAgICAgICAgKEdJRkltYWdlUmVhZGVyOjpyZWFkKToK
KwogMjAwNy0xMS0xMyAgRGFuIEJlcm5zdGVpbiAgPG1pdHpAYXBwbGUuY29tPgogCiAgICAgICAg
IFJldmlld2VkIGJ5IEJldGggRGFraW4uCkluZGV4OiBXZWJDb3JlL3BsYXRmb3JtL2ltYWdlLWRl
Y29kZXJzL2dpZi9HSUZJbWFnZVJlYWRlci5jcHAKPT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gV2ViQ29yZS9wbGF0
Zm9ybS9pbWFnZS1kZWNvZGVycy9naWYvR0lGSW1hZ2VSZWFkZXIuY3BwCShyZXZpc2lvbiAyNzc2
MCkKKysrIFdlYkNvcmUvcGxhdGZvcm0vaW1hZ2UtZGVjb2RlcnMvZ2lmL0dJRkltYWdlUmVhZGVy
LmNwcAkod29ya2luZyBjb3B5KQpAQCAtMzc4LDggKzM3OCwxMCBAQCBpbnQgR0lGSW1hZ2VSZWFk
ZXI6OmRvX2x6dyhjb25zdCB1bnNpZ25lCiBib29sIEdJRkltYWdlUmVhZGVyOjpyZWFkKGNvbnN0
IHVuc2lnbmVkIGNoYXIgKmJ1ZiwgdW5zaWduZWQgbGVuLCAKICAgICAgICAgICAgICAgICAgICAg
IEdJRkltYWdlRGVjb2Rlcjo6R0lGUXVlcnkgcXVlcnksIHVuc2lnbmVkIGhhbHRBdEZyYW1lKQog
ewotICBpZiAoIWxlbikKLSAgICByZXR1cm4gZmFsc2U7CisgIGlmICghbGVuKSB7CisgICAgLy8g
Tm8gbmV3IGRhdGEgaGFzIGNvbWUgaW4gc2luY2UgdGhlIGxhc3QgY2FsbCwganVzdCBpZ25vcmUg
dGhpcyBjYWxsLgorICAgIHJldHVybiB0cnVlOworICB9CiAKICAgY29uc3QgdW5zaWduZWQgY2hh
ciAqcSA9IGJ1ZjsKIAo=
</data>
<flag name="review"
          id="7352"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>