Skip to content

Commit 087baa4

Browse files
committed
BC-49261 Fix parsing of Unicode values
1 parent bf61dc6 commit 087baa4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: lib/decode.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ int smile_decode(s_stream *strm)
179179
} else if (BYTE() >= 0x80 && BYTE() <= 0x9F) {
180180
// Tiny Unicode
181181
// 5 LSB used to indicate _byte_ lengths from 2 to 33
182-
smile_value_length = (BYTE() & 0x1F) + 1;
182+
smile_value_length = (BYTE() & 0x1F) + 2;
183183
COPY_VALUE_STRING();
184184
} else if (BYTE() >= 0xA0 && BYTE() <= 0xBF) {
185185
// Small Unicode
186186
// 5 LSB used to indicate _byte_ lengths from 34 to 65
187-
smile_value_length = (BYTE() & 0x1F) + 33;
187+
smile_value_length = (BYTE() & 0x1F) + 34;
188188
COPY_VALUE_STRING();
189189
} else if (BYTE() >= 0xC0 && BYTE() <= 0xDF) {
190190
// Small integers

0 commit comments

Comments
 (0)