From 5f80ff49403645dc574296bb8b29fe44a2193c3c Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Thu, 16 Aug 2018 19:21:07 +0000 Subject: If rows need to overflow in a PDF417 barcode, keep it to a minimum. By using mincols as fallback, the exact opposite is done. Maxcols should be used instead to minimize the size. This is important so the next fix (https://pdfium-review.googlesource.com/c/pdfium/+/40350) does not break a test that was working well by coincidence. Bug: pdfium:1135 Change-Id: I95ddc547654966f655e2556c1796503a5456fb8f Reviewed-on: https://pdfium-review.googlesource.com/40330 Reviewed-by: Ryan Harrison Commit-Queue: Ryan Harrison --- fxbarcode/pdf417/BC_PDF417.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fxbarcode/pdf417/BC_PDF417.cpp b/fxbarcode/pdf417/BC_PDF417.cpp index 9b73b49a26..d0ecaccf55 100644 --- a/fxbarcode/pdf417/BC_PDF417.cpp +++ b/fxbarcode/pdf417/BC_PDF417.cpp @@ -562,14 +562,14 @@ std::vector CBC_PDF417::determineDimensions( } if (dimensions.empty()) { int32_t rows = calculateNumberOfRows(sourceCodeWords, - errorCorrectionCodeWords, m_minCols); + errorCorrectionCodeWords, m_maxCols); if (rows < m_minRows) { dimensions.resize(2); - dimensions[0] = m_minCols; + dimensions[0] = m_maxCols; dimensions[1] = m_minRows; } else if (rows >= 3 && rows <= 90) { dimensions.resize(2); - dimensions[0] = m_minCols; + dimensions[0] = m_maxCols; dimensions[1] = rows; } } -- cgit v1.2.3