aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/skottie/src/SkottieTest.cpp
blob: 1c4cc078a5e520506697f2fd3793573afcd6ed3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * Copyright 2018 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "Skottie.h"
#include "SkStream.h"

#include "Test.h"

DEF_TEST(Skottie_OssFuzz8956, reporter) {
    static constexpr const char json[] =
        "{\"v\":\" \",\"fr\":3,\"w\":4,\"h\":3,\"layers\":[{\"ty\": 1, \"sw\": 10, \"sh\": 10,"
            " \"sc\":\"#ffffff\", \"ks\":{\"o\":{\"a\": true, \"k\":"
            " [{\"t\": 0, \"s\": 0, \"e\": 1, \"i\": {\"x\":[]}}]}}}]}";

    SkMemoryStream stream(json, strlen(json));

    // Passes if parsing doesn't crash.
    auto animation = skottie::Animation::Make(&stream);
}