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

Unified Diff: core/fxcodec/jbig2/JBig2_TrdProc.cpp

Issue 2202013002: Bound total pixels in JBig2 images to avoid overflows later. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Add tests 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
Index: core/fxcodec/jbig2/JBig2_TrdProc.cpp
diff --git a/core/fxcodec/jbig2/JBig2_TrdProc.cpp b/core/fxcodec/jbig2/JBig2_TrdProc.cpp
index 177db9dec934d1c15f9c67e26fce61a2f243a953..f3dd6be2b31660d96dcb5a71f9f7448c657a7360 100644
--- a/core/fxcodec/jbig2/JBig2_TrdProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_TrdProc.cpp
@@ -114,8 +114,8 @@ CJBig2_Image* CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream* pStream,
if (!IBOI)
return nullptr;
- uint32_t WOI = IBOI->m_nWidth;
- uint32_t HOI = IBOI->m_nHeight;
+ uint32_t WOI = IBOI->width();
+ uint32_t HOI = IBOI->height();
if ((int)(WOI + RDWI) < 0 || (int)(HOI + RDHI) < 0)
return nullptr;
@@ -150,8 +150,8 @@ CJBig2_Image* CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream* pStream,
if (!IBI) {
continue;
}
- uint32_t WI = IBI->m_nWidth;
- uint32_t HI = IBI->m_nHeight;
+ uint32_t WI = IBI->width();
+ uint32_t HI = IBI->height();
if (TRANSPOSED == 0 && ((REFCORNER == JBIG2_CORNER_TOPRIGHT) ||
(REFCORNER == JBIG2_CORNER_BOTTOMRIGHT))) {
CURS = CURS + WI - 1;
@@ -327,8 +327,8 @@ CJBig2_Image* CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
if (!IBOI)
return nullptr;
- uint32_t WOI = IBOI->m_nWidth;
- uint32_t HOI = IBOI->m_nHeight;
+ uint32_t WOI = IBOI->width();
+ uint32_t HOI = IBOI->height();
if ((int)(WOI + RDWI) < 0 || (int)(HOI + RDHI) < 0)
return nullptr;
@@ -350,8 +350,8 @@ CJBig2_Image* CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
if (!pIBI)
return nullptr;
- uint32_t WI = pIBI->m_nWidth;
- uint32_t HI = pIBI->m_nHeight;
+ uint32_t WI = pIBI->width();
+ uint32_t HI = pIBI->height();
if (TRANSPOSED == 0 && ((REFCORNER == JBIG2_CORNER_TOPRIGHT) ||
(REFCORNER == JBIG2_CORNER_BOTTOMRIGHT))) {
CURS += WI - 1;
« core/fxcodec/jbig2/JBig2_Image_unittest.cpp ('K') | « core/fxcodec/jbig2/JBig2_SddProc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698