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

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

Issue 2248383002: Fix integer overflow (-INT_MIN) in blink::BMPImageReader::readInfoHeader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/bmp/BMPImageReader.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp b/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp
index 0ee27a6cd0630716f58445f3d3dfc4242a98b676..3fb77d66b4022ec27d03ccb071c588a71504f653 100644
--- a/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp
@@ -307,6 +307,8 @@ bool BMPImageReader::readInfoHeader()
// Detect top-down BMPs.
if (m_infoHeader.biHeight < 0) {
+ if (m_infoHeader.biHeight == INT32_MIN)
Peter Kasting 2016/08/17 22:21:24 Nit: I think this deserves a comment, e.g.: We ca
aleksandar.stojiljkovic 2016/08/18 21:31:00 Done.
+ return false;
Peter Kasting 2016/08/17 22:21:24 You need to return m_parent->setFailed() here, not
aleksandar.stojiljkovic 2016/08/18 21:31:00 Done. Thanks. Although the returned false gets pro
m_isTopDown = true;
m_infoHeader.biHeight = -m_infoHeader.biHeight;
}
« 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