Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\lzo\lzo1x_decompress_safe.c Create Date:2022-07-28 07:00:21
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:lzo1x_decompress_safe

Proto:int lzo1x_decompress_safe(const unsigned char *in, size_t in_len, unsigned char *out, size_t *out_len)

Type:int

Parameter:

TypeParameterName
const unsigned char *in
size_tin_len
unsigned char *out
size_t *out_len
45  state = 0
47  ip_end = in + in_len
48  op_end = out + out_len
52  op = out
53  ip = in
55  If Value for the false possibility is greater at compile time(in_len < 3) Then Go to input_overrun
58  If Value is more likely to compile time(in_len >= 5) && Value is more likely to compile time( * ip == 17) Then
59  bitstream_version = ip[1]
60  ip += 2
61  Else
62  bitstream_version = 0
65  If ip > 17 Then
66  t = * ip++ - 17
67  If t < 4 Then
68  next = t
69  Go to match_next
71  Go to copy_literal_run
74  cycle
75  t = ip++
76  If t < 16 Then
120  Else if state != 4 Then
121  next = t & 3
122  m_pos = op - 1
123  m_pos -= t >> 2
124  m_pos -= ip++ << 2
125  TEST_LB(m_pos)
126  NEED_OP(2)
127  op[0] = m_pos[0]
128  op[1] = m_pos[1]
129  op += 2
130  Go to match_next
131  Else
132  next = t & 3
133  m_pos = op - 1 + M2_MAX_OFFSET
134  m_pos -= t >> 2
135  m_pos -= ip++ << 2
136  t = 3
138  Else if t >= 64 Then
139  next = t & 3
140  m_pos = op - 1
141  m_pos -= t >> 2 & 7
142  m_pos -= ip++ << 3
143  t = (t >> 5) - 1 + 3 - 1
144  Else if t >= 32 Then
145  t = (t & 31) + 3 - 1
162  m_pos = op - 1
164  ip += 2
165  m_pos -= next >> 2
166  next &= 3
167  Else
168  NEED_IP(2)
170  If (next & 0xfffc) == 0xfffc && (t & 0xf8) == 0x18 && Value is more likely to compile time(bitstream_version) Then
173  NEED_IP(3)
174  t &= 7
175  t |= ip[2] << 3
177  NEED_OP(t)
178  memset(op, 0, t)
179  op += t
180  next &= 3
181  ip += 3
182  Go to match_next
183  Else
212  TEST_LB(m_pos)
242  oe = op + t
243  NEED_OP(t)
244  op[0] = m_pos[0]
245  op[1] = m_pos[1]
246  op += 2
247  m_pos += 2
248  Do
249  op++ = m_pos++
250  When op < oe cycle
252  match_next :
253  state = next
254  t = next
263  NEED_IP(t + 3)
264  NEED_OP(t)
265  When t > 0 cycle
266  op++ = ip++
267  t--
272  eof_found :
273  out_len = op - out
274  Return If If If t != 3 Then LZO_E_ERROR Else ip == ip_end Then Return values (< 0 = Error) Else ip < ip_end Then LZO_E_INPUT_NOT_CONSUMED Else LZO_E_INPUT_OVERRUN
278  input_overrun :
279  out_len = op - out
280  Return LZO_E_INPUT_OVERRUN
282  output_overrun :
283  out_len = op - out
284  Return LZO_E_OUTPUT_OVERRUN
286  lookbehind_overrun :
287  out_len = op - out
288  Return LZO_E_LOOKBEHIND_OVERRUN
Caller
NameDescribe
unlzo