diff options
author | Albert Astals Cid <aacid@kde.org> | 2021-01-06 00:06:03 +0100 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2021-01-06 00:06:37 +0100 |
commit | 2b82271415000e776b54f0214d564d28170d9c6b (patch) | |
tree | d09e42a7a0da2a641a0b669501722a4dd9299082 | |
parent | d0497325555d60c8c44f8945f5a99ab6a4d7c252 (diff) |
JBIG2Stream::readTextRegion: Fix yet another potential integer overflow
oss-fuzz/27783
-rw-r--r-- | poppler/JBIG2Stream.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc index db46b1ae..111fac02 100644 --- a/poppler/JBIG2Stream.cc +++ b/poppler/JBIG2Stream.cc @@ -2316,7 +2316,9 @@ std::unique_ptr<JBIG2Bitmap> JBIG2Stream::readTextRegion(bool huff, bool refine, if (decodeSuccess && syms[symID]) { refDX = ((rdw >= 0) ? rdw : rdw - 1) / 2 + rdx; - refDY = ((rdh >= 0) ? rdh : rdh - 1) / 2 + rdy; + if (checkedAdd(((rdh >= 0) ? rdh : rdh - 1) / 2, rdy, &refDY)) { + return nullptr; + } symbolBitmap = readGenericRefinementRegion(rdw + syms[symID]->getWidth(), rdh + syms[symID]->getHeight(), templ, false, syms[symID], refDX, refDY, atx, aty).release(); } |