Fuzz skpicture with ReadBuffer

Bug: skia:
Change-Id: Id581895b5248a8f24eed77cad20fc751257c2c95
Reviewed-on: https://skia-review.googlesource.com/83861
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This commit is contained in:
Kevin Lubick 2017-12-12 12:52:39 -05:00 committed by Skia Commit-Bot
parent d21b2a5d5c
commit 09757b29fe

View File

@ -440,9 +440,9 @@ static void fuzz_img(sk_sp<SkData> bytes, uint8_t scale, uint8_t mode) {
}
static void fuzz_skp(sk_sp<SkData> bytes) {
SkMemoryStream stream(bytes);
SkReadBuffer buf(bytes->data(), bytes->size());
SkDebugf("Decoding\n");
sk_sp<SkPicture> pic(SkPicture::MakeFromStream(&stream));
sk_sp<SkPicture> pic(SkPicture::MakeFromBuffer(buf));
if (!pic) {
SkDebugf("[terminated] Couldn't decode as a picture.\n");
return;