mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-12-26 08:22:23 +00:00
Fix crash in unloaded null Image.
This commit is contained in:
parent
906122a334
commit
88a82eecf3
@ -43,12 +43,14 @@ QImage ImageSource::takeLoaded() {
|
||||
|
||||
void ImageSource::unload() {
|
||||
if (_bytes.isEmpty() && !_data.isNull()) {
|
||||
if (_format.isEmpty()) {
|
||||
if (_format != "JPG") {
|
||||
_format = "PNG";
|
||||
}
|
||||
|
||||
QBuffer buffer(&_bytes);
|
||||
_data.save(&buffer, _format);
|
||||
{
|
||||
QBuffer buffer(&_bytes);
|
||||
_data.save(&buffer, _format);
|
||||
}
|
||||
Assert(!_bytes.isEmpty());
|
||||
}
|
||||
_data = QImage();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user