glassechidna / zxing-cpp

ZXing C++ Library
Apache License 2.0
598 stars 435 forks source link

Bugfix UPCAReader #4

Closed SebGDev closed 9 years ago

SebGDev commented 9 years ago

The maybeReturnResult function checks whether the Result is UPCA or EAN13. The old version returned an uninitialised Ref (at the EAN13 case) which let MultiFormatUPCEANReader::decodeRow (line 90) crash because a Result is assumed.

The bugfix is technically oriented at the java version.

Note: This error doesn't appear at normal tests because the MultiFormatUPCEANReader uses the EAN13 reader for UPC-A detection. The UPCAReader is only used if DecodeHints BarcodeFormat::UPC_A ist set.