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

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

Issue 1571233003: Fix errors caused by unsafe conversions to/from size_t (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improved ALLOW_NUMERIC_ARG_TYPES_PROMOTABLE_TO Created 4 years, 11 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
Index: third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
index d6b36fa9478d7a636e7ef4c35e0ed50e31e328c0..5e3fd56c252b085e04744899b3ad87ddf6de2812 100644
--- a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -378,7 +378,7 @@ public:
}
const char* segment;
- const unsigned bytes = m_data->getSomeData(segment, m_nextReadPosition);
+ const size_t bytes = m_data->getSomeData(segment, m_nextReadPosition);
if (bytes == 0) {
// We had to suspend. When we resume, we will need to start from the restart position.
m_needsRestart = true;
@@ -706,9 +706,9 @@ private:
// Input reading: True if we need to back up to m_restartPosition.
bool m_needsRestart;
// If libjpeg needed to restart, this is the position to restart from.
- unsigned m_restartPosition;
+ size_t m_restartPosition;
// This is the position where we will read from, unless there is a restart.
- unsigned m_nextReadPosition;
+ size_t m_nextReadPosition;
// This is how we know to update the restart position. It is the last value
// we set to next_input_byte. libjpeg will update next_input_byte when it
// has found the next restart position, so if it no longer matches this

Powered by Google App Engine
This is Rietveld 408576698