diff --git a/poppler/JPEG2000Stream.cc b/poppler/JPEG2000Stream.cc index 7daa23d..714d814 100644 --- a/poppler/JPEG2000Stream.cc +++ b/poppler/JPEG2000Stream.cc @@ -368,7 +368,7 @@ void JPXStream::init() if (getDict()) getDict()->lookup("SMaskInData", &smaskInData); int bufSize = BUFFER_INITIAL_SIZE; - if (oLen.isInt()) bufSize = oLen.getInt(); + if (oLen.isInt() && oLen.getInt() > 0) bufSize = oLen.getInt(); oLen.free(); if (cspace.isArray() && cspace.arrayGetLength() > 0) {