fixed datamatrix detection (incorrect) in ean13 2

This commit is contained in:
Henry Schimke
2022-12-29 17:33:45 -06:00
parent 3469f7c599
commit 09f25bfacc
8 changed files with 120 additions and 195 deletions

View File

@@ -97,7 +97,9 @@ impl ReedSolomonDecoder {
//for (int i = 0; i < errorLocations.length; i++) {
let log_value = self.field.log(errorLocations[i] as i32)?;
if log_value > received.len() as i32 - 1 {
return Ok(0);
return Err(Exceptions::ReedSolomonException(
"Bad error location".to_owned(),
));
}
let position: isize = received.len() as isize - 1 - log_value as isize;
if position < 0 {