File CVE-2019-9200.patch of Package poppler-qt5.31254

From f4136a6353162db249f63ddb0f20611622ab61b4 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Wed, 27 Feb 2019 19:43:22 +0100
Subject: [PATCH] ImageStream::getLine: fix crash on broken files

Fixes #728
---
 poppler/Stream.cc | 3 +++
 1 file changed, 3 insertions(+)

Index: poppler-0.62.0/poppler/Stream.cc
===================================================================
--- poppler-0.62.0.orig/poppler/Stream.cc	2017-12-03 19:25:06.000000000 +0000
+++ poppler-0.62.0/poppler/Stream.cc	2019-03-20 11:53:02.309770363 +0000
@@ -505,6 +505,9 @@ Guchar *ImageStream::getLine() {
   }
  
   int readChars = str->doGetChars(inputLineSize, inputLine);
+  if (unlikely(readChars == -1)) {
+      readChars = 0;
+  }
   for ( ; readChars < inputLineSize; readChars++) inputLine[readChars] = EOF;
   if (nBits == 1) {
     p = inputLine;
openSUSE Build Service is sponsored by