Rizin
unix-like reverse engineering framework and cli tools
filter_flags_decoder.c File Reference

Decodes a Filter Flags field. More...

#include "filter_decoder.h"

Go to the source code of this file.

Functions

 LZMA_API (lzma_ret)
 

Detailed Description

Decodes a Filter Flags field.

Definition in file filter_flags_decoder.c.

Function Documentation

◆ LZMA_API()

LZMA_API ( lzma_ret  )

Definition at line 16 of file filter_flags_decoder.c.

20 {
21  // Set the pointer to NULL so the caller can always safely free it.
22  filter->options = NULL;
23 
24  // Filter ID
25  return_if_error(lzma_vli_decode(&filter->id, NULL,
26  in, in_pos, in_size));
27 
29  return LZMA_DATA_ERROR;
30 
31  // Size of Properties
32  lzma_vli props_size;
33  return_if_error(lzma_vli_decode(&props_size, NULL,
34  in, in_pos, in_size));
35 
36  // Filter Properties
37  if (in_size - *in_pos < props_size)
38  return LZMA_DATA_ERROR;
39 
40  const lzma_ret ret = lzma_properties_decode(
41  filter, allocator, in + *in_pos, props_size);
42 
43  *in_pos += props_size;
44 
45  return ret;
46 }
const lzma_allocator const uint8_t size_t * in_pos
Definition: block.h:579
const lzma_allocator const uint8_t size_t in_size
Definition: block.h:527
const lzma_allocator * allocator
Definition: block.h:377
const lzma_allocator const uint8_t * in
Definition: block.h:527
#define NULL
Definition: cris-opc.c:27
#define return_if_error(expr)
Return if expression doesn't evaluate to LZMA_OK.
Definition: common.h:278
#define LZMA_FILTER_RESERVED_START
Definition: common.h:67
uint64_t lzma_vli
Variable-length integer type.
Definition: vli.h:63
lzma_ret
Return values used by several functions in liblzma.
Definition: base.h:57
@ LZMA_DATA_ERROR
Data is corrupt.
Definition: base.h:172

References allocator, in, in_pos, in_size, LZMA_DATA_ERROR, LZMA_FILTER_RESERVED_START, NULL, and return_if_error.