mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-03 21:54:05 +02:00
Fix assertion violation in profile video with zero file size.
This commit is contained in:
parent
f5a323e40a
commit
5de83ef30c
1 changed files with 3 additions and 2 deletions
|
@ -2619,13 +2619,14 @@ void Session::photoApplyFields(
|
|||
}
|
||||
const auto area = [](const MTPVideoSize &size) {
|
||||
return size.match([](const MTPDvideoSize &data) {
|
||||
return data.vw().v * data.vh().v;
|
||||
return data.vsize().v ? (data.vw().v * data.vh().v) : 0;
|
||||
});
|
||||
};
|
||||
return *ranges::max_element(
|
||||
const auto result = *ranges::max_element(
|
||||
sizes->v,
|
||||
std::greater<>(),
|
||||
area);
|
||||
return (area(result) > 0) ? std::make_optional(result) : std::nullopt;
|
||||
};
|
||||
const auto useProgressive = (progressive != sizes.end());
|
||||
const auto large = useProgressive
|
||||
|
|
Loading…
Add table
Reference in a new issue