Harden SerializedImageFilter fuzzer against filter creation failure

Change-Id: Ic9cc0e17af55300a0de4eab7a61d150f2c07314a
Reviewed-on: https://skia-review.googlesource.com/154626
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2018-09-14 11:58:40 -04:00 committed by Skia Commit-Bot
parent f026d896dc
commit 66f6ef41b9

View File

@ -1753,6 +1753,9 @@ DEF_FUZZ(ImageFilter, fuzz) {
DEF_FUZZ(SerializedImageFilter, fuzz) {
auto filter = make_fuzz_imageFilter(fuzz, 20);
if (!filter) {
return;
}
auto data = filter->serialize();
const unsigned char* ptr = static_cast<const unsigned char*>(data->data());
size_t len = data->size();