Skip to content

Commit

Permalink
Also handle negative values cf #272.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjohnde committed Dec 4, 2018
1 parent 47704a8 commit f7fe106
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ZXingObjC/common/ZXHybridBinarizer.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ - (ZXBitMatrix *)blackMatrixWithError:(NSError **)error {
ZXLuminanceSource *source = [self luminanceSource];
int width = source.width;
int height = source.height;
if (width == 0 || height == 0) {
NSDictionary *userInfo = @{NSLocalizedDescriptionKey: @"Source is empty"};
if (width <= 0 || height <= 0) {
NSDictionary *userInfo = @{NSLocalizedDescriptionKey: @"Source is empty or misbehaving."};
if (error) *error = [[NSError alloc] initWithDomain:ZXErrorDomain code:ZXNotFoundError userInfo:userInfo];
return nil;
}
Expand Down

0 comments on commit f7fe106

Please sign in to comment.