lottie/parser: Asset id can be number for effect object. 24/194224/1
authorsubhransu mohanty <sub.mohanty@samsung.com>
Fri, 30 Nov 2018 06:12:36 +0000 (15:12 +0900)
committersubhransu mohanty <sub.mohanty@samsung.com>
Fri, 30 Nov 2018 06:12:36 +0000 (15:12 +0900)
Change-Id: I6a8b447960a3d10e714125279b83efa27d21581a

src/lottie/lottieparser.cpp

index 2c0493f..3a563c4 100644 (file)
@@ -617,8 +617,12 @@ std::shared_ptr<LOTAsset> LottieParserImpl::parseAsset()
             RAPIDJSON_ASSERT(PeekType() == kNumberType);
             asset->mAssetType = GetInt();
         } else if (0 == strcmp(key, "id")) { /* reference id*/
-            RAPIDJSON_ASSERT(PeekType() == kStringType);
-            asset->mRefId = std::string(GetString());
+            if (PeekType() == kStringType) {
+                asset->mRefId = std::string(GetString());
+            } else {
+                RAPIDJSON_ASSERT(PeekType() == kNumberType);
+                asset->mRefId = std::to_string(GetInt());
+            }
         } else if (0 == strcmp(key, "layers")) {
             RAPIDJSON_ASSERT(PeekType() == kArrayType);
             EnterArray();