ofz#3743 Divide-by-zero

Change-Id: I6cdc8b4c852a126c8740fc23c10f9360d8caf1a5
Reviewed-on: https://gerrit.libreoffice.org/43752
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2017-10-24 11:35:10 +01:00
parent 38081c0884
commit d6bf6c5851

View File

@@ -478,12 +478,20 @@ namespace emfio
break;
default :
{
fWidth /= mnWinExtX;
fHeight /= mnWinExtY;
fWidth *= mnDevWidth;
fHeight *= mnDevHeight;
fWidth *= (double)mnMillX * 100 / (double)mnPixX;
fHeight *= (double)mnMillY * 100 / (double)mnPixY;
if (mnPixX == 0 || mnPixY == 0)
{
SAL_WARN("vcl.emf", "invalid scaling factor");
return Size();
}
else
{
fWidth /= mnWinExtX;
fHeight /= mnWinExtY;
fWidth *= mnDevWidth;
fHeight *= mnDevHeight;
fWidth *= (double)mnMillX * 100.0 / (double)mnPixX;
fHeight *= (double)mnMillY * 100.0 / (double)mnPixY;
}
}
break;
}