diff options
author | Lei Zhang <thestig@chromium.org> | 2018-04-27 16:54:28 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-27 16:54:28 +0000 |
commit | 61f66c9be2abf4f2a5f8bc299ad6e1900c63dbc3 (patch) | |
tree | 4dc0116df63dce8414b8c08c272e5d0878ed8f03 /core/fxcodec/jbig2/JBig2_GrrdProc.cpp | |
parent | 0e3635c59e79e8ca782412fa1bcf377c7c4f980e (diff) | |
download | pdfium-61f66c9be2abf4f2a5f8bc299ad6e1900c63dbc3.tar.xz |
Add CJBig2_Image::IsValidImageSize() helper method.
Change-Id: Ic2acd6f03b9b2e52b3d94d7579d5dc36c8e62c96
Reviewed-on: https://pdfium-review.googlesource.com/31530
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_GrrdProc.cpp')
-rw-r--r-- | core/fxcodec/jbig2/JBig2_GrrdProc.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/core/fxcodec/jbig2/JBig2_GrrdProc.cpp b/core/fxcodec/jbig2/JBig2_GrrdProc.cpp index f5f569c04a..8622090006 100644 --- a/core/fxcodec/jbig2/JBig2_GrrdProc.cpp +++ b/core/fxcodec/jbig2/JBig2_GrrdProc.cpp @@ -16,10 +16,8 @@ std::unique_ptr<CJBig2_Image> CJBig2_GRRDProc::decode( CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* grContext) { - if (GRW == 0 || GRW > JBIG2_MAX_IMAGE_SIZE || GRH == 0 || - GRH > JBIG2_MAX_IMAGE_SIZE) { + if (!CJBig2_Image::IsValidImageSize(GRW, GRH)) return pdfium::MakeUnique<CJBig2_Image>(GRW, GRH); - } if (!GRTEMPLATE) { if ((GRAT[0] == -1) && (GRAT[1] == -1) && (GRAT[2] == -1) && |