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:
@@ -478,12 +478,20 @@ namespace emfio
|
|||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
{
|
{
|
||||||
fWidth /= mnWinExtX;
|
if (mnPixX == 0 || mnPixY == 0)
|
||||||
fHeight /= mnWinExtY;
|
{
|
||||||
fWidth *= mnDevWidth;
|
SAL_WARN("vcl.emf", "invalid scaling factor");
|
||||||
fHeight *= mnDevHeight;
|
return Size();
|
||||||
fWidth *= (double)mnMillX * 100 / (double)mnPixX;
|
}
|
||||||
fHeight *= (double)mnMillY * 100 / (double)mnPixY;
|
else
|
||||||
|
{
|
||||||
|
fWidth /= mnWinExtX;
|
||||||
|
fHeight /= mnWinExtY;
|
||||||
|
fWidth *= mnDevWidth;
|
||||||
|
fHeight *= mnDevHeight;
|
||||||
|
fWidth *= (double)mnMillX * 100.0 / (double)mnPixX;
|
||||||
|
fHeight *= (double)mnMillY * 100.0 / (double)mnPixY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user