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

Unified Diff: core/fxcodec/codec/fx_codec_fax.cpp

Issue 2398033002: Fix assertion failure when decoding malform G4 fax image (Closed)
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcodec/codec/fx_codec_fax.cpp
diff --git a/core/fxcodec/codec/fx_codec_fax.cpp b/core/fxcodec/codec/fx_codec_fax.cpp
index 336c35b8d4b319bb856681f098164bdc6a102be0..c121478c3c3c268ce4a10cb83e6c2f6575a83493 100644
--- a/core/fxcodec/codec/fx_codec_fax.cpp
+++ b/core/fxcodec/codec/fx_codec_fax.cpp
@@ -390,6 +390,10 @@ FX_BOOL FaxG4GetRow(const uint8_t* src_buf,
if (a1 >= columns)
return TRUE;
+ // The position of picture element must be monotonic increasing.
+ if (a0 >= a1)
+ return FALSE;
+
a0 = a1;
a0color = !a0color;
}
« 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