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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp

Issue 2907143002: Remove unnecessary decoded frame size overflow check (Closed)
Patch Set: Initial patch to remove decoded frame size overflow check Created 3 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e7eac4b4a3f696ab1f6871dafc99fab7d4d1b4e3..a42a39a3749ac7e710e8eafbb71472899a394c3f 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
@@ -407,13 +407,8 @@ void ImageDecoder::UpdateAggressivePurging(size_t index) {
// As we decode we will learn the total number of frames, and thus total
// possible image memory used.
- const uint64_t frame_area = DecodedSize().Area();
- const uint64_t frame_memory_usage = frame_area * 4; // 4 bytes per pixel
- if (frame_memory_usage / 4 != frame_area) { // overflow occurred
Srirama 2017/05/30 07:07:39 though it looks like it is doing nothing, this wou
- purge_aggressively_ = true;
- return;
- }
-
+ const uint64_t frame_memory_usage =
+ DecodedSize().Area() * 4; // 4 bytes per pixel
const uint64_t total_memory_usage = frame_memory_usage * index;
if (total_memory_usage / frame_memory_usage != index) { // overflow occurred
purge_aggressively_ = true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698