From 2cd81bae2aaa2d3a675ec0027cc720be3f939231 Mon Sep 17 00:00:00 2001 From: flyashi Date: Thu, 29 Jul 2010 18:52:24 +0000 Subject: [PATCH] C++ port: UPCEAN reader fixes - make UPCEANReader fail if there's no quiet zone after the end marker, vastly reducing UPC_E false positives git-svn-id: https://zxing.googlecode.com/svn/trunk@1495 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- cpp/core/src/zxing/oned/UPCEANReader.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cpp/core/src/zxing/oned/UPCEANReader.cpp b/cpp/core/src/zxing/oned/UPCEANReader.cpp index e0154c533..ef143b85a 100644 --- a/cpp/core/src/zxing/oned/UPCEANReader.cpp +++ b/cpp/core/src/zxing/oned/UPCEANReader.cpp @@ -113,14 +113,13 @@ namespace zxing { int* endRange = decodeEnd(row, endStart); -#pragma mark QuietZone needs some change // Make sure there is a quiet zone at least as big as the end pattern after the barcode. The // spec might want more whitespace, but in practice this is the maximum we can count on. -// int end = endRange[1]; -// int quietEnd = end + (end - endRange[0]); -// if (quietEnd >= row->getSize() || !row->isRange(end, quietEnd, false)) { -// throw ReaderException("Quiet zone asserrt fail."); -// } + size_t end = endRange[1]; + size_t quietEnd = end + (end - endRange[0]); + if (quietEnd >= row->getSize() || !row->isRange(end, quietEnd, false)) { + throw ReaderException("Quiet zone asserrt fail."); + } if (!checkChecksum(tmpResultString)) { if (startGuardRange!=NULL) {