[skottie] Harden json string parsing

TBR=
Change-Id: I538d1a86c1adc4a00deffc254c8bfde8d5d6794b
Reviewed-on: https://skia-review.googlesource.com/121324
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
This commit is contained in:
Florin Malita 2018-04-13 11:01:32 -04:00 committed by Skia Commit-Bot
parent d4228473a5
commit 21d3f9016f

View File

@ -57,7 +57,7 @@ bool Parse<SkString>(const Json::Value& jv, SkString* v) {
if (jv.isNull() || !jv.isConvertibleTo(Json::stringValue))
return false;
v->set(jv.asCString());
v->set(jv.isString() ? jv.asCString() : jv.asString().c_str());
return true;
}