C++: ITFReader.cpp was throwing wrong exception
authorflyashi <flyashi@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Tue, 27 Jul 2010 23:02:28 +0000 (23:02 +0000)
committerflyashi <flyashi@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Tue, 27 Jul 2010 23:02:28 +0000 (23:02 +0000)
ITFReader.cpp:75 was catching and re-throwing Exception instead of ReaderException, causing scanning to terminate prematurely in some cases (i.e. core/test/data/blackbox/ean13-1/23.JPG). The calling function, MultiFormatOneDReader::doDecode, is only catching ReaderException's. An Exception would be passed all the way up to the caller, even if scanning hasn't finished yet for other decoders for other rows.

git-svn-id: http://zxing.googlecode.com/svn/trunk@1493 59b500cc-1b3d-0410-9834-0bbf25fbcc57

cpp/core/src/zxing/oned/ITFReader.cpp

index 4464326..95e7a1c 100644 (file)
@@ -72,7 +72,7 @@ namespace zxing {
                        int* endRange;
                        try {
                                endRange = decodeEnd(row);
-                       } catch (Exception e) {
+                       } catch (ReaderException e) {
                                delete [] startRange;
                                throw e;
                        }