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

Unified Diff: core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp

Issue 1305033006: Guard against null image data in CJBig2_GRRDProc. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@b514891_clean_aaa_cobject_rm2
Patch Set: belt and suspenders, no goto Created 5 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
Index: core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp
diff --git a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp
index 2e558ee7e87626815a34b5e320005796ca831c6f..1c56db984b31d9ac30eb29b82ad1dc1ac37b65ef 100644
--- a/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp
@@ -719,6 +719,9 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template0_unopt(
CJBig2_Image* CJBig2_GRRDProc::decode_Template0_opt(
CJBig2_ArithDecoder* pArithDecoder,
JBig2ArithCtx* grContext) {
+ if (!GRREFERENCE->m_pData)
+ return nullptr;
+
FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
FX_DWORD line1, line1_r, line2_r, line3_r;
@@ -953,6 +956,9 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template1_unopt(
CJBig2_Image* CJBig2_GRRDProc::decode_Template1_opt(
CJBig2_ArithDecoder* pArithDecoder,
JBig2ArithCtx* grContext) {
+ if (!GRREFERENCE->m_pData)
+ return nullptr;
+
FX_BOOL LTP, SLTP, bVal;
FX_DWORD CONTEXT;
FX_DWORD line1, line1_r, line2_r, line3_r;

Powered by Google App Engine
This is Rietveld 408576698