@@ -533,6 +533,16 @@ procedure TZXingDelphiTest.AllQRCode();
533533 FreeAndNil(result);
534534 end ;
535535
536+
537+ try
538+ result := Decode(' QR-bug-overflow.png' , TBarcodeFormat.QR_CODE);
539+ Assert.IsNotNull(result, ' Nil result' );
540+ Assert.Contains(result.Text, ' 1653015096' , false);
541+
542+ finally
543+ FreeAndNil(result);
544+ end ;
545+
536546end ;
537547
538548// This ones will only work when PURE_BARCODE is existing in the additional hints.
@@ -542,8 +552,6 @@ procedure TZXingDelphiTest.All_PURE_QRCode();
542552 hints: TDictionary<TDecodeHintType, TObject>;
543553begin
544554
545-
546-
547555 hints := TDictionary<TDecodeHintType, TObject>.Create();
548556 hints.Add(TDecodeHintType.PURE_BARCODE, nil );
549557
@@ -1089,11 +1097,18 @@ procedure TZXingDelphiTest.AutoTypes;
10891097var
10901098 result: TReadResult;
10911099begin
1100+
1101+ try
1102+ result := Decode(' QR-bug-overflow.png' , TBarcodeFormat.EAN_13);
1103+ Assert.IsNull(result, ' Nil result' );
1104+ finally
1105+ FreeAndNil(result);
1106+ end ;
1107+
10921108 try
10931109 result := Decode(' Code128.png' , TBarcodeFormat.Auto);
10941110 Assert.IsNotNull(result, ' Nil result ' );
10951111 Assert.IsTrue(result.Text.Equals(' 1234567' ), ' Code 128 result Text Incorrect: ' + result.Text);
1096-
10971112 finally
10981113 FreeAndNil(result);
10991114 end ;
@@ -1111,7 +1126,6 @@ procedure TZXingDelphiTest.AutoTypes;
11111126 result := Decode(' Code128.png' , TBarcodeFormat.Auto);
11121127 Assert.IsNotNull(result, ' Nil result ' );
11131128 Assert.IsTrue(result.Text.Equals(' 1234567' ), ' Code 128 result Text Incorrect: ' + result.Text);
1114-
11151129 finally
11161130 FreeAndNil(result);
11171131 end ;
@@ -1214,6 +1228,7 @@ procedure TZXingDelphiTest.AutoTypes;
12141228 finally
12151229 FreeAndNil(result);
12161230 end ;
1231+
12171232end ;
12181233
12191234// / /////////////////////////////////////////////////////////////////////////////
0 commit comments