forked from mirrors/gecko-dev
Bug 1921797 - Check for degenerate ratio in nsCocoaUtis. r=mac-reviewers,mstange,bradwerth a=RyanVM
This is the straight-forward, uncontroversial fix, that can be uplifted. Differential Revision: https://phabricator.services.mozilla.com/D224211
This commit is contained in:
parent
4d0702759a
commit
5e26dbfdc7
1 changed files with 1 additions and 1 deletions
|
|
@ -523,7 +523,7 @@ nsresult nsCocoaUtils::CreateNSImageFromImageContainer(
|
|||
{
|
||||
const bool gotWidth = NS_SUCCEEDED(aImage->GetWidth(&width));
|
||||
const bool gotHeight = NS_SUCCEEDED(aImage->GetHeight(&height));
|
||||
if (auto ratio = aImage->GetIntrinsicRatio()) {
|
||||
if (auto ratio = aImage->GetIntrinsicRatio(); ratio && *ratio) {
|
||||
if (gotWidth != gotHeight) {
|
||||
if (gotWidth) {
|
||||
height = ratio->Inverted().ApplyTo(width);
|
||||
|
|
|
|||
Loading…
Reference in a new issue