Validate number of components before deserializing
Check that the number of components in the serialized data is valid (matches the number of components of the layer) before deserializing.
Check that the number of components in the serialized data is valid (matches the number of components of the layer) before deserializing.