mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-14 02:10:15 +00:00
[NoCopyRendering] In non-VM case, use calloc to get a zerod buffer. (#869)
This commit is contained in:
parent
e748d053d1
commit
e90ba47a13
@ -19,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
AS_SUBCLASSING_RESTRICTED
|
||||
@interface ASCGImageBuffer : NSObject
|
||||
|
||||
/// Init a zero-filled buffer with the given length.
|
||||
- (instancetype)initWithLength:(NSUInteger)length;
|
||||
|
||||
@property (readonly) void *mutableBytes NS_RETURNS_INNER_POINTER;
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
|
||||
// Check the VM flag again because we may have failed above.
|
||||
if (!_isVM) {
|
||||
_mutableBytes = malloc(length);
|
||||
_mutableBytes = calloc(1, length);
|
||||
}
|
||||
}
|
||||
return self;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user