From c916e0952b88d5b866ab80e2f71dd8b6f18f93bd Mon Sep 17 00:00:00 2001 From: favoritas37 Date: Sat, 23 Jan 2016 20:57:37 +0200 Subject: [PATCH] Bug fix for edge case in UPC reader. Row to be decoded was null producing null results. Added TODO for future work. --- src/zxing/zxing/oned/MultiFormatUPCEANReader.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/zxing/zxing/oned/MultiFormatUPCEANReader.cpp b/src/zxing/zxing/oned/MultiFormatUPCEANReader.cpp index 298b380..0376649 100644 --- a/src/zxing/zxing/oned/MultiFormatUPCEANReader.cpp +++ b/src/zxing/zxing/oned/MultiFormatUPCEANReader.cpp @@ -74,6 +74,11 @@ Ref MultiFormatUPCEANReader::decodeRow(int rowNumber, Ref row) continue; } + //added this because reader->decodeRow returns null if row is null + //TODO: investigate why the execution reaches here with empty row. + if(result.empty()) + continue; + // Special case: a 12-digit code encoded in UPC-A is identical // to a "0" followed by those 12 digits encoded as EAN-13. Each // will recognize such a code, UPC-A as a 12-digit string and