Chromium Code Reviews| Index: Source/core/html/ImageDocument.cpp |
| diff --git a/Source/core/html/ImageDocument.cpp b/Source/core/html/ImageDocument.cpp |
| index ee0542a0943d1b38d4bde7e45f9885258fe77171..c4c4de4da90e9e7382dcf405a99502dd4e87de6a 100644 |
| --- a/Source/core/html/ImageDocument.cpp |
| +++ b/Source/core/html/ImageDocument.cpp |
| @@ -43,6 +43,7 @@ |
| #include "core/loader/FrameLoader.h" |
| #include "core/loader/FrameLoaderClient.h" |
| #include "wtf/text/StringBuilder.h" |
| +#include <limits.h> |
| using std::min; |
| @@ -128,8 +129,10 @@ void ImageDocumentParser::appendBytes(const char* data, size_t length) |
| if (!frame->loader().client()->allowImage(!settings || settings->imagesEnabled(), document()->url())) |
| return; |
| - if (document()->cachedImage()) |
| + if (document()->cachedImage()) { |
| + ASSERT(length <= UINT_MAX); |
|
kouhei (in TOK)
2014/09/30 07:23:03
Can we have more reasonable limit for this?
kouhei (in TOK)
2014/09/30 07:41:22
RELEASE_ASSERT(length <= std::numeric_limits<unsig
tyoshino (SeeGerritForStatus)
2014/09/30 08:14:28
Done.
|
| document()->cachedImage()->appendData(data, length); |
| + } |
| // Make sure the image renderer gets created because we need the renderer |
| // to read the aspect ratio. See crbug.com/320244 |
| document()->updateRenderTreeIfNeeded(); |