mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Weakened animated sticker parameters checks
This commit is contained in:
parent
eddb05b020
commit
9a662ab2df
@ -66,11 +66,7 @@ NSData * _Nullable TGGUnzipData(NSData *data, uint sizeLimit)
|
||||
}
|
||||
|
||||
if (stream.total_out >= output.length) {
|
||||
NSUInteger length = output.length + data.length / 2;
|
||||
if (sizeLimit > 0 && length > sizeLimit) {
|
||||
return nil;
|
||||
}
|
||||
output.length = length;
|
||||
output.length = output.length + data.length / 2;
|
||||
}
|
||||
stream.next_out = (uint8_t *)output.mutableBytes + stream.total_out;
|
||||
stream.avail_out = (uInt)(output.length - stream.total_out);
|
||||
@ -79,6 +75,8 @@ NSData * _Nullable TGGUnzipData(NSData *data, uint sizeLimit)
|
||||
if (inflateEnd(&stream) == Z_OK) {
|
||||
if (status == Z_STREAM_END) {
|
||||
output.length = stream.total_out;
|
||||
} else if (sizeLimit > 0 && output.length > sizeLimit) {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,14 +21,7 @@
|
||||
_frameCount = (int32_t)_animation->totalFrame();
|
||||
_frameRate = (int32_t)_animation->frameRate();
|
||||
|
||||
size_t width = 0;
|
||||
size_t height = 0;
|
||||
_animation->size(width, height);
|
||||
|
||||
if (width != height || (width != 100 && width != 512)) {
|
||||
return nil;
|
||||
}
|
||||
if ((_frameRate > 30 && _frameRate != 60) || _animation->duration() > 4.5) {
|
||||
if ((_frameRate > 60) || _animation->duration() > 4.5) {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user