From 29f1960495cd8740744d8bcd55f5cf2c60e41e43 Mon Sep 17 00:00:00 2001 From: Hib Eris Date: Sun, 9 Feb 2014 22:48:26 +0100 Subject: [PATCH] Make sure number of least objects in hints table is valid Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=74741 --- poppler/Hints.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/poppler/Hints.cc b/poppler/Hints.cc index 49e201d..70e1532 100644 --- a/poppler/Hints.cc +++ b/poppler/Hints.cc @@ -176,6 +176,11 @@ void Hints::readPageOffsetTable(Stream *str) inputBits = 0; // reset on byte boundary. nObjectLeast = readBits(32, str); + if (nObjectLeast < 1) { + error(-1, "Invalid least number of objects reading page offset hints table"); + nPages = 0; + return; + } objectOffsetFirst = readBits(32, str); if (objectOffsetFirst >= hintsOffset) objectOffsetFirst += hintsLength; -- 1.8.1.2