Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(791)

Unified Diff: Source/core/html/ImageDocument.cpp

Issue 618583002: Correct data size argument type in resource loading path to unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add static_cast to RELEASE_ASSERT in AssociatedURLLoader::ClientAdapter::didReceiveData Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/fileapi/FileReaderLoader.cpp ('k') | Source/core/html/imports/HTMLImportLoader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/ImageDocument.cpp
diff --git a/Source/core/html/ImageDocument.cpp b/Source/core/html/ImageDocument.cpp
index ee0542a0943d1b38d4bde7e45f9885258fe77171..f20e8d50eaffbd36cf4e5f78c6bed9eb545bdeee 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>
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()) {
+ RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max());
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();
« no previous file with comments | « Source/core/fileapi/FileReaderLoader.cpp ('k') | Source/core/html/imports/HTMLImportLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698