vcl/source/gdi/pdfextoutdevdata.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit a8caa0ef1c0b5926caa9dfc4752c6d355dea6765
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Mon Apr 3 16:42:08 2017 +0200

    vcl: avoid divide by zero in PDFExtOutDevData::HasAdequateCompression()
    
    My stub graphic import filter created a graphic with 0 data size, don't
    crash on that.
    
    Change-Id: Ie9b93fce1bcae04d555a0610f674603c6945a54a
    Reviewed-on: https://gerrit.libreoffice.org/36048
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>
    Tested-by: Jenkins <c...@libreoffice.org>

diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx 
b/vcl/source/gdi/pdfextoutdevdata.cxx
index 0175d5faea91..f97f4002c871 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -828,6 +828,8 @@ bool PDFExtOutDevData::HasAdequateCompression( const 
Graphic &rGraphic,
     // FIXME: ideally we'd also pre-empt the DPI related scaling too.
 
     Size aSize = rGraphic.GetSizePixel();
+    if (rGraphic.GetLink().GetDataSize() == 0)
+        return false;
     sal_Int32 nCurrentRatio = (100 * aSize.Width() * aSize.Height() * 4) /
                                rGraphic.GetLink().GetDataSize();
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to