Skip to content

Commit 844daff

Browse files
authored
1 parent d2a7eff commit 844daff

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pandas/io/sas/sas.pyx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ cdef const uint8_t[:] rle_decompress(int result_length, const uint8_t[:] inbuff)
2727
end_of_first_byte = <int>(inbuff[ipos] & 0x0F)
2828
ipos += 1
2929

30-
if control_byte == 0x00:
31-
if end_of_first_byte != 0:
32-
raise ValueError("Unexpected non-zero end_of_first_byte")
33-
nbytes = <int>(inbuff[ipos]) + 64
30+
if control_byte == 0x00 and ipos < length:
31+
nbytes = <int>(inbuff[ipos] & 0xFF) + 64 + end_of_first_byte * 256
3432
ipos += 1
3533
for _ in range(nbytes):
3634
result[rpos] = inbuff[ipos]

0 commit comments

Comments
 (0)