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 <rharrison@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
diff --git a/fxbarcode/pdf417/BC_PDF417.cpp b/fxbarcode/pdf417/BC_PDF417.cpp index 9b73b49..d0ecacc 100644 --- a/fxbarcode/pdf417/BC_PDF417.cpp +++ b/fxbarcode/pdf417/BC_PDF417.cpp
@@ -562,14 +562,14 @@ } 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; } }