Remove unreachable code in Jbig2Module::StartDecode().
As a result, |FXCODEC_STATUS_ERR_PARAMS| can be marked as XFA-only,
and so can other FXCODEC_STATUS_ERR_* values.
Change-Id: I627c7e9a8cdc8bdb384b4f7825656dad80f8cafd
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/69311
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fxcodec/fx_codec_def.h b/core/fxcodec/fx_codec_def.h
index 2d6b5ed..c76f5bb 100644
--- a/core/fxcodec/fx_codec_def.h
+++ b/core/fxcodec/fx_codec_def.h
@@ -16,11 +16,11 @@
FXCODEC_STATUS_DECODE_FINISH,
#ifdef PDF_ENABLE_XFA
FXCODEC_STATUS_ERR_MEMORY,
-#endif // PDF_ENABLE_XFA
FXCODEC_STATUS_ERR_READ,
FXCODEC_STATUS_ERR_FLUSH,
FXCODEC_STATUS_ERR_FORMAT,
FXCODEC_STATUS_ERR_PARAMS
+#endif // PDF_ENABLE_XFA
};
#ifdef PDF_ENABLE_XFA
diff --git a/core/fxcodec/jbig2/jbig2module.cpp b/core/fxcodec/jbig2/jbig2module.cpp
index 6f99143..2b78814 100644
--- a/core/fxcodec/jbig2/jbig2module.cpp
+++ b/core/fxcodec/jbig2/jbig2module.cpp
@@ -39,8 +39,7 @@
uint8_t* dest_buf,
uint32_t dest_pitch,
PauseIndicatorIface* pPause) {
- if (!pJbig2Context)
- return FXCODEC_STATUS_ERR_PARAMS;
+ ASSERT(pJbig2Context);
JBig2_DocumentContext* pJBig2DocumentContext =
GetJBig2DocumentContext(pContextHolder);