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;
|
delete splashOut;
|
||||||
|
|
||||||
Object globals;
|
XRef *xref = doc.getXRef();
|
||||||
BaseStream *base_str = doc.getBaseStream();
|
int objNums = xref->getNumObjects();
|
||||||
if (base_str) {
|
Object currentObj;
|
||||||
JBIG2Stream *str = new JBIG2Stream(base_str, &globals);
|
for (int i = 0; i < objNums; ++i) {
|
||||||
str->reset();
|
if (xref->fetch(i, 0, ¤tObj)->isStream()){
|
||||||
delete str;
|
currentObj.getStream()->reset();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
globals.free();
|
currentObj.free();
|
||||||
}
|
}
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue