[poppler] utils/HtmlOutputDev.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Mon May 23 21:21:01 UTC 2016


 utils/HtmlOutputDev.cc |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 37fb37e368c659832fc1a1dfd499c42340b62f38
Author: Vincent Le Garrec <legarrec.vincent at gmail.com>
Date:   Mon May 23 23:18:40 2016 +0200

    pdftohtml: Fix crash on broken file
    
    Bug #95563

diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc
index 35e98b4..51d09e1 100644
--- a/utils/HtmlOutputDev.cc
+++ b/utils/HtmlOutputDev.cc
@@ -38,6 +38,7 @@
 // Copyright (C) 2013 Julien Nabet <serval2412 at yahoo.fr>
 // Copyright (C) 2013 Johannes Brandstätter <jbrandstaetter at gmail.com>
 // Copyright (C) 2014 Fabio D'Urso <fabiodurso at hotmail.it>
+// Copyright (C) 2015 Vincent Le Garrec <legarrec.vincent at gmail.com>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -1392,6 +1393,13 @@ void HtmlOutputDev::drawPngImage(GfxState *state, Stream *str, int width, int he
 
       // Convert into a PNG row
       p = imgStr->getLine();
+      if (!p) {
+        error(errIO, -1, "Failed to read PNG. '{0:t}' will be incorrect", fName);
+        delete writer;
+        delete imgStr;
+        fclose(f1);
+        return;
+      }
       for (int x = 0; x < width; x++) {
         colorMap->getRGB(p, &rgb);
         // Write the RGB pixels into the row


More information about the poppler mailing list