Commit 752f43d4e4fc6348db63d17b1984116493cc5b2f
1 parent
62d47bff
Allow empty b: binary JSON strings
Showing
5 changed files
with
15 additions
and
11 deletions
libqpdf/QPDF_json.cc
| @@ -128,7 +128,7 @@ is_binary_string(std::string const& v, std::string& str) | @@ -128,7 +128,7 @@ is_binary_string(std::string const& v, std::string& str) | ||
| 128 | } | 128 | } |
| 129 | ++count; | 129 | ++count; |
| 130 | } | 130 | } |
| 131 | - return ((count > 0) && (count % 2 == 0)); | 131 | + return (count % 2 == 0); |
| 132 | } | 132 | } |
| 133 | return false; | 133 | return false; |
| 134 | } | 134 | } |
| @@ -180,10 +180,10 @@ QPDF::test_json_validators() | @@ -180,10 +180,10 @@ QPDF::test_json_validators() | ||
| 180 | check(str == ""); | 180 | check(str == ""); |
| 181 | check(!is_binary_string("", str)); | 181 | check(!is_binary_string("", str)); |
| 182 | check(!is_binary_string("x:", str)); | 182 | check(!is_binary_string("x:", str)); |
| 183 | - check(!is_binary_string("b:", str)); | ||
| 184 | check(!is_binary_string("b:1", str)); | 183 | check(!is_binary_string("b:1", str)); |
| 185 | check(!is_binary_string("b:123", str)); | 184 | check(!is_binary_string("b:123", str)); |
| 186 | check(!is_binary_string("b:gh", str)); | 185 | check(!is_binary_string("b:gh", str)); |
| 186 | + check(is_binary_string("b:", str)); | ||
| 187 | check(is_binary_string("b:12", str)); | 187 | check(is_binary_string("b:12", str)); |
| 188 | check(is_binary_string("b:123aBC", str)); | 188 | check(is_binary_string("b:123aBC", str)); |
| 189 | check(!is_name("")); | 189 | check(!is_name("")); |
qpdf/qtest/qpdf/manual-qpdf-json-out.json
qpdf/qtest/qpdf/manual-qpdf-json-pdf.json
qpdf/qtest/qpdf/manual-qpdf-json.json
qpdf/qtest/qpdf/manual-qpdf-json.pdf
| @@ -47,6 +47,7 @@ endobj | @@ -47,6 +47,7 @@ endobj | ||
| 47 | (one) | 47 | (one) |
| 48 | <24a2> | 48 | <24a2> |
| 49 | () | 49 | () |
| 50 | + () | ||
| 50 | (\(\)) | 51 | (\(\)) |
| 51 | (\() | 52 | (\() |
| 52 | (\)) | 53 | (\)) |
| @@ -163,14 +164,14 @@ xref | @@ -163,14 +164,14 @@ xref | ||
| 163 | 0000000000 65535 f | 164 | 0000000000 65535 f |
| 164 | 0000000052 00000 n | 165 | 0000000052 00000 n |
| 165 | 0000000133 00000 n | 166 | 0000000133 00000 n |
| 166 | -0000000829 00000 n | ||
| 167 | -0000000928 00000 n | ||
| 168 | -0000001029 00000 n | ||
| 169 | -0000001251 00000 n | ||
| 170 | -0000001322 00000 n | ||
| 171 | -0000001421 00000 n | ||
| 172 | -0000001467 00000 n | ||
| 173 | -0000001612 00000 n | 167 | +0000000836 00000 n |
| 168 | +0000000935 00000 n | ||
| 169 | +0000001036 00000 n | ||
| 170 | +0000001258 00000 n | ||
| 171 | +0000001329 00000 n | ||
| 172 | +0000001428 00000 n | ||
| 173 | +0000001474 00000 n | ||
| 174 | +0000001619 00000 n | ||
| 174 | trailer << | 175 | trailer << |
| 175 | /QTest 2 0 R | 176 | /QTest 2 0 R |
| 176 | /Root 1 0 R | 177 | /Root 1 0 R |
| @@ -178,5 +179,5 @@ trailer << | @@ -178,5 +179,5 @@ trailer << | ||
| 178 | /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] | 179 | /ID [<31415926535897932384626433832795><31415926535897932384626433832795>] |
| 179 | >> | 180 | >> |
| 180 | startxref | 181 | startxref |
| 181 | -1648 | 182 | +1655 |
| 182 | %%EOF | 183 | %%EOF |