Commit 0dea2769978d52e56e270fdc5ca868e0f2223cb0

Authored by Jay Berkenbilt
1 parent 802de87c

Fix fix-qdf for empty streams

Showing 2 changed files with 9 additions and 1 deletions
ChangeLog
  1 +2020-10-23 Jay Berkenbilt <ejb@ql.org>
  2 +
  3 + * Bug fix: fix-qdf: properly handle empty streams with ignore
  4 + newline.
  5 +
1 2020-10-22 Jay Berkenbilt <ejb@ql.org> 6 2020-10-22 Jay Berkenbilt <ejb@ql.org>
2 7
3 * Fix loop detection problem when traversing page thumbnails 8 * Fix loop detection problem when traversing page thumbnails
qpdf/fix-qdf.cc
@@ -294,7 +294,10 @@ QdfFixer::processLines(std::list&lt;std::string&gt;&amp; lines) @@ -294,7 +294,10 @@ QdfFixer::processLines(std::list&lt;std::string&gt;&amp; lines)
294 { 294 {
295 if (matches(re_ignore_newline)) 295 if (matches(re_ignore_newline))
296 { 296 {
297 - --stream_length; 297 + if (stream_length > 0)
  298 + {
  299 + --stream_length;
  300 + }
298 } 301 }
299 else if (matches(re_n_0_obj)) 302 else if (matches(re_n_0_obj))
300 { 303 {