Check for invalid data

This commit is contained in:
Ali
2021-11-05 14:04:04 +04:00
parent d6007323ec
commit 556572dd6d

View File

@@ -26,7 +26,7 @@ final class SoftwareAnimationRenderer: ASDisplayNode, AnimationRenderer {
guard let baseAddress = bytes.baseAddress else {
return
}
if bytesPerRow * height > bytes.count {
if bytesPerRow <= 0 || height <= 0 || width <= 0 || bytesPerRow * height > bytes.count {
assert(false)
return
}