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

Unified Diff: Source/platform/image-decoders/bmp/BMPImageDecoder.cpp

Issue 556913002: Use reference instead of pointer in BMPImageDecoder::processFileHeader (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Assert removed Created 6 years, 3 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/platform/image-decoders/bmp/BMPImageDecoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/image-decoders/bmp/BMPImageDecoder.cpp
diff --git a/Source/platform/image-decoders/bmp/BMPImageDecoder.cpp b/Source/platform/image-decoders/bmp/BMPImageDecoder.cpp
index 4d0dcc47ce65f6145a106307f9d2e7350ad815b6..9b2a4d654748d1e17b0f4df7e7f8769227b1b8f9 100644
--- a/Source/platform/image-decoders/bmp/BMPImageDecoder.cpp
+++ b/Source/platform/image-decoders/bmp/BMPImageDecoder.cpp
@@ -110,7 +110,7 @@ void BMPImageDecoder::decode(bool onlySize)
bool BMPImageDecoder::decodeHelper(bool onlySize)
{
size_t imgDataOffset = 0;
- if ((m_decodedOffset < sizeOfFileHeader) && !processFileHeader(&imgDataOffset))
+ if ((m_decodedOffset < sizeOfFileHeader) && !processFileHeader(imgDataOffset))
return false;
if (!m_reader) {
@@ -124,16 +124,14 @@ bool BMPImageDecoder::decodeHelper(bool onlySize)
return m_reader->decodeBMP(onlySize);
}
-bool BMPImageDecoder::processFileHeader(size_t* imgDataOffset)
+bool BMPImageDecoder::processFileHeader(size_t& imgDataOffset)
{
- ASSERT(imgDataOffset);
-
// Read file header.
ASSERT(!m_decodedOffset);
if (m_data->size() < sizeOfFileHeader)
return false;
const uint16_t fileType = (m_data->data()[0] << 8) | static_cast<uint8_t>(m_data->data()[1]);
- *imgDataOffset = readUint32(10);
+ imgDataOffset = readUint32(10);
m_decodedOffset = sizeOfFileHeader;
// See if this is a bitmap filetype we understand.
« no previous file with comments | « Source/platform/image-decoders/bmp/BMPImageDecoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698