Add checks for incorrect sticker cache bytes.

This commit is contained in:
John Preston 2019-07-10 12:52:36 +02:00
parent b9d3ba621e
commit c3c6571835
1 changed files with 3 additions and 0 deletions

View File

@ -594,6 +594,9 @@ void Cache::prepareBuffers() {
}
Cache::ReadResult Cache::readCompressedFrame() {
if (_data.size() < _offset) {
return { false };
}
auto length = qint32(0);
const auto part = bytes::make_span(_data).subspan(_offset);
if (part.size() < sizeof(length)) {