Index: Source/core/platform/image-decoders/gif/GIFImageReader.cpp |
diff --git a/Source/core/platform/image-decoders/gif/GIFImageReader.cpp b/Source/core/platform/image-decoders/gif/GIFImageReader.cpp |
index 1a7268a19ba20c71a3e76a1bbd410d6ca1fe63cf..f38ea31acc59b5008c39d914c6ab02103015f53d 100644 |
--- a/Source/core/platform/image-decoders/gif/GIFImageReader.cpp |
+++ b/Source/core/platform/image-decoders/gif/GIFImageReader.cpp |
@@ -494,15 +494,19 @@ bool GIFImageReader::parse(size_t dataPosition, size_t len, bool parseSizeOnly) |
break; |
} |
+ if (*currentComponent == ',') { // image separator. |
+ GETN(9, GIFImageHeader); |
+ break; |
+ } |
+ |
// If we get anything other than ',' (image separator), '!' |
// (extension), or ';' (trailer), there is extraneous data |
// between blocks. The GIF87a spec tells us to keep reading |
// until we find an image separator, but GIF89a says such |
- // a file is corrupt. We follow GIF89a and bail out. |
- if (*currentComponent != ',') |
- return false; |
- |
- GETN(9, GIFImageHeader); |
+ // a file is corrupt. We follow Mozilla's implementation and |
+ // proceed as if the file were correctly terminated, so the |
+ // GIF will display. |
+ GETN(0, GIFDone); |
break; |
} |