message: gltfio: fix ASAN issue when consuming invalid animation.
  Release builds do not call cgltf_validate() so it was possible to
  read out-of-bounds animation data when encountering a badly formed glTF
  file with mismatched counts between sampler inputs and outputs.
diff: @@ -139,6 +139,31 @@ static void setTransformType(const cgltf_animation_channel& src, Channel& dst) {
  }
  }
  +static bool validateAnimation(const cgltf_animation& anim) {
  + for (cgltf_size j = 0; j < anim.channels_count; ++j) {
  + const cgltf_animation_channel& channel = anim.channels[j];
  + const cgltf_animation_sampler* sampler = channel.sampler;
  + if (!channel.target_node) {
  + continue;
  + }
  + if (!channel.sampler) {
  + return false;
  + }
  + cgltf_size components = 1;
  + if (channel.target_path == cgltf_animation_path_type_weights) {
  + if (!channel.target_node->mesh || !channel.target_node->mesh->primitives_count) {
  + return false;
  + }
  + components = channel.target_node->mesh->primitives[0].targets_count;
  + }
  + cgltf_size values = sampler->interpolation == cgltf_interpolation_type_cubic_spline ? 3 : 1;
  + if (sampler->input->count * components * values != sampler->output->count) {
  + return false;
  + }
  + }
  + return true;
  +}
  +
  Animator::Animator(FFilamentAsset* asset, FFilamentInstance* instance) {
  assert(asset->mResourcesLoaded && !asset->mIsReleased);
  mImpl = new AnimatorImpl();
  @@ -147,6 +172,16 @@ Animator::Animator(FFilamentAsset* asset, FFilamentInstance* instance) {
  mImpl->renderableManager = &asset->mEngine->getRenderableManager();
  mImpl->transformManager = &asset->mEngine->getTransformManager();
  + const cgltf_data* srcAsset = asset->mSourceAsset;
  + const cgltf_animation* srcAnims = srcAsset->animations;
  + for (cgltf_size i = 0, len = srcAsset->animations_count; i < len; ++i) {
  + const cgltf_animation& anim = srcAnims[i];
  + if (!validateAnimation(anim)) {
  + slog.e << "Disabling animation due to validation failure." << io::endl;
  + return;
  + }
  + }
  +
  auto addChannels = [](const NodeMap& nodeMap, const cgltf_animation& srcAnim, Animation& dst) {
  cgltf_animation_channel* srcChannels = srcAnim.channels;
  cgltf_animation_sampler* srcSamplers = srcAnim.samplers;
  @@ -163,8 +198,6 @@ Animator::Animator(FFilamentAsset* asset, FFilamentInstance* instance) {
  };
  // Loop over the glTF animation definitions.
  - const cgltf_data* srcAsset = asset->mSourceAsset;
  - const cgltf_animation* srcAnims = srcAsset->animations;
  mImpl->animations.resize(srcAsset->animations_count);
  for (cgltf_size i = 0, len = srcAsset->animations_count; i < len; ++i) {
  const cgltf_animation& srcAnim = srcAnims[i];
  