Index: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp |
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp |
index b3bd7d93278ee227f858d7c18dbbf28eacff334c..2db06cd59449567bdb89c4940156bea6fadf0768 100644 |
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp |
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp |
@@ -80,12 +80,16 @@ inline bool matchesBMPSignature(const char* contents) |
return !memcmp(contents, "BM", 2); |
} |
-std::unique_ptr<ImageDecoder> ImageDecoder::create(const char* contents, size_t length, AlphaOption alphaOption, GammaAndColorProfileOption colorOptions) |
+size_t ImageDecoder::longestSignatureLength() |
{ |
const size_t longestSignatureLength = sizeof("RIFF????WEBPVP") - 1; |
- ASSERT(longestSignatureLength == 14); |
+ DCHECK_EQ(14u, longestSignatureLength); |
+ return 14u; |
+} |
- if (length < longestSignatureLength) |
+std::unique_ptr<ImageDecoder> ImageDecoder::create(const char* contents, size_t length, AlphaOption alphaOption, GammaAndColorProfileOption colorOptions) |
+{ |
+ if (length < longestSignatureLength()) |
return nullptr; |
size_t maxDecodedBytes = Platform::current() ? Platform::current()->maxDecodedImageBytes() : noDecodedImageByteLimit; |