mirror of https://github.com/google/oss-fuzz.git
Fuzz JBIG2 code by checking on each object in PDF file (#7508)
This commit is contained in:
parent
8bad6b2c75
commit
b3b6f748cc
|
@ -118,14 +118,15 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|||
|
||||
delete splashOut;
|
||||
|
||||
Object globals;
|
||||
BaseStream *base_str = doc.getBaseStream();
|
||||
if (base_str) {
|
||||
JBIG2Stream *str = new JBIG2Stream(base_str, &globals);
|
||||
str->reset();
|
||||
delete str;
|
||||
XRef *xref = doc.getXRef();
|
||||
int objNums = xref->getNumObjects();
|
||||
Object currentObj;
|
||||
for (int i = 0; i < objNums; ++i) {
|
||||
if (xref->fetch(i, 0, ¤tObj)->isStream()){
|
||||
currentObj.getStream()->reset();
|
||||
}
|
||||
globals.free();
|
||||
}
|
||||
currentObj.free();
|
||||
}
|
||||
} catch (...) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue