diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-01-14 10:17:30 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-01-14 14:51:31 +0100 |
commit | 32aae380b02de10a433e633186de7fcb85511530 (patch) | |
tree | d5c4b677596d9ccec4f20429ffbecc7b2a30ff0d | |
parent | af343d6bc40cf97007632247c1af662a4587f155 (diff) |
cid#1471674 help coverity see that "Division or modulo by zero" is bogus
Change-Id: I82fc94d242e446d434c257471e80a6db2536e8aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109267
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/source/gdi/pdfextoutdevdata.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx index da7e78dcbcd9..8ba808e21579 100644 --- a/vcl/source/gdi/pdfextoutdevdata.cxx +++ b/vcl/source/gdi/pdfextoutdevdata.cxx @@ -839,7 +839,8 @@ bool PDFExtOutDevData::HasAdequateCompression( const Graphic &rGraphic, // wanted. return false; - if (rGraphic.GetGfxLink().GetDataSize() == 0) + auto nSize = rGraphic.GetGfxLink().GetDataSize(); + if (nSize == 0) return false; GfxLink aLink = rGraphic.GetGfxLink(); @@ -862,7 +863,7 @@ bool PDFExtOutDevData::HasAdequateCompression( const Graphic &rGraphic, // FIXME: ideally we'd also pre-empt the DPI related scaling too. sal_Int32 nCurrentRatio = (100 * aSize.Width() * aSize.Height() * 4) / - rGraphic.GetGfxLink().GetDataSize(); + nSize; static const struct { sal_Int32 mnQuality; |