Repository navigation
Lottie crash while decoding Base64 image assets #2699
Hashim1999164
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Lottie crash while decoding Base64 image assets
Crash
Fatal Exception: NSMallocException
*** -[_NSPlaceholderData _initWithBase64EncodedObject:options:]: unable to allocate memory for length (30576)
Stack trace
CoreFoundation
__exceptionPreprocess
Foundation
Data.init(base64Encoded:options:)
ImageAsset.swift:105
Data.init(dataString:options:) + 105
ImageAsset.swift:81
BundleImageProvider.imageForAsset(asset:) + 81
protocol witness for AnimationImageProvider.imageForAsset(asset:)
in conformance BundleImageProvider
CachedImageProvider.swift:26
CachedImageProvider.imageForAsset(asset:) + 26
protocol witness for AnimationImageProvider.imageForAsset(asset:)
in conformance CachedImageProvider
ImageLayer.swift:42
ImageLayer.setupImage(context:) + 42
ImageLayer.swift:19
LayerModel.makeAnimationLayer(context:) + 19
Description
Lottie crashes with "NSMallocException" while decoding a Base64 image asset.
The crash occurs inside:
Data(base64Encoded:options:)
Expected behavior
Lottie should handle invalid or unexpectedly large Base64 image assets gracefully without crashing the application.
Actual behavior
The application terminates with "NSMallocException" during image asset loading.
Thanks
All reactions