diff options
author | Nicolas Pena <npm@chromium.org> | 2017-12-01 21:40:23 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-12-01 21:40:23 +0000 |
commit | dca380ffe0571be4023b11b06b8aecad9934bb06 (patch) | |
tree | 17daabe5cc361a543dd69f8f783c34f5a5a598d4 /core/fxcodec/jbig2/JBig2_ArithIntDecoder.h | |
parent | 752e9bf892abdf1ee588ba87c857d0783a017b27 (diff) | |
download | pdfium-dca380ffe0571be4023b11b06b8aecad9934bb06.tar.xz |
Check for success of decodes to avoid infinite loops
Bug: 790693
Change-Id: I9b1d87e024229d8b01f55ec554e2cc544db6ac06
Reviewed-on: https://pdfium-review.googlesource.com/20230
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_ArithIntDecoder.h')
-rw-r--r-- | core/fxcodec/jbig2/JBig2_ArithIntDecoder.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/fxcodec/jbig2/JBig2_ArithIntDecoder.h b/core/fxcodec/jbig2/JBig2_ArithIntDecoder.h index fd9fa89f19..2de42a09ee 100644 --- a/core/fxcodec/jbig2/JBig2_ArithIntDecoder.h +++ b/core/fxcodec/jbig2/JBig2_ArithIntDecoder.h @@ -17,8 +17,7 @@ class CJBig2_ArithIntDecoder { CJBig2_ArithIntDecoder(); ~CJBig2_ArithIntDecoder(); - // Returns true on success, and false when an OOB condition occurs. Many - // callers can tolerate OOB and do not check the return value. + // Returns true on success, and false when an OOB condition occurs. bool decode(CJBig2_ArithDecoder* pArithDecoder, int* nResult); private: @@ -30,7 +29,7 @@ class CJBig2_ArithIaidDecoder { explicit CJBig2_ArithIaidDecoder(unsigned char SBSYMCODELENA); ~CJBig2_ArithIaidDecoder(); - void decode(CJBig2_ArithDecoder* pArithDecoder, uint32_t* nResult); + bool decode(CJBig2_ArithDecoder* pArithDecoder, uint32_t* nResult); private: std::vector<JBig2ArithCtx> m_IAID; |