Commit 4139f79c authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

TextPage::coalesce: Fix crash on broken files

oss-fuzz/47350
parent 4eeb3380
......@@ -20,7 +20,7 @@
// Copyright (C) 2006 Jeff Muizelaar <jeff@infidigm.net>
// Copyright (C) 2007, 2008, 2012, 2017 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2008 Koji Otani <sho@bbr.jp>
// Copyright (C) 2008, 2010-2012, 2014-2021 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2008, 2010-2012, 2014-2022 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2008 Pino Toscano <pino@kde.org>
// Copyright (C) 2008, 2010 Hib Eris <hib@hiberis.nl>
// Copyright (C) 2009 Ross Moore <ross@maths.mq.edu.au>
......@@ -3637,6 +3637,7 @@ void TextPage::coalesce(bool physLayout, double fixedPitch, bool doHTML, double
envelopes[i].x2 = DBL_MIN;
envelopes[i].y1 = DBL_MAX;
envelopes[i].y2 = DBL_MIN;
ending_blocks[i] = nullptr;
}
for (blk1 = blkList; blk1; blk1 = blk1->next) {
......@@ -3661,7 +3662,7 @@ void TextPage::coalesce(bool physLayout, double fixedPitch, bool doHTML, double
}
for (blk1 = blkList; blk1; blk1 = blk1->next) {
if (blk1->tableId >= 0 && blk1->xMin <= ending_blocks[blk1->tableId]->xMax && blk1->xMax >= ending_blocks[blk1->tableId]->xMin) {
if (blk1->tableId >= 0 && ending_blocks[blk1->tableId] && blk1->xMin <= ending_blocks[blk1->tableId]->xMax && blk1->xMax >= ending_blocks[blk1->tableId]->xMin) {
blk1->tableEnd = true;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment