mirror of https://github.com/google/oss-fuzz.git
Add a check to prevent cairo from immediately crashing (#4992)
This commit is contained in:
parent
613d735dc7
commit
0ba7eeef2e
|
@ -26,6 +26,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||
cairo_surface_t *surface;
|
||||
cairo_status_t status;
|
||||
|
||||
if (size == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *tmpfile = fuzzer_get_tmpfile(data, size);
|
||||
surface = cairo_pdf_surface_create(tmpfile, width_in_points, height_in_points);
|
||||
status = cairo_surface_status(surface);
|
||||
|
|
Loading…
Reference in New Issue