41 tmp = bytestream2_get_byte(gb);
42 val |= (tmp & 127) << shift;
55 len += bytestream2_get_le32(gb);
58 len += bytestream2_get_le24(gb);
61 len += bytestream2_get_le16(gb);
64 len += bytestream2_get_byte(gb);
79 unsigned int off,
int len)
83 if (off > p - start || size < len)
88 for (i = 0; i <
len; i++)
97 int len = 4 + (val & 0x7);
98 unsigned int off = bytestream2_get_byte(gb) | (val & 0x38) << 5;
107 unsigned int off = bytestream2_get_le16(gb);
116 unsigned int off = bytestream2_get_le32(gb);
125 if (len < 0 || len > UINT_MAX)
157 uint8_t s = bytestream2_get_byte(gb);
const char const char void * val
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int shift(int a, int b)
memory handling functions
static int snappy_copy(uint8_t *start, uint8_t *p, int size, unsigned int off, int len)
int64_t ff_snappy_peek_uncompressed_length(GetByteContext *gb)
Get the uncompressed length of an input buffer compressed using the Snappy algorithm.
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
static int snappy_copy4(GetByteContext *gb, uint8_t *start, uint8_t *p, int size, int val)
int ff_snappy_uncompress(GetByteContext *gb, uint8_t *buf, int64_t *size)
Decompress an input buffer using Snappy algorithm.
#define AVERROR_BUFFER_TOO_SMALL
Buffer too small.
static int snappy_literal(GetByteContext *gb, uint8_t *p, int size, int val)
static int snappy_copy1(GetByteContext *gb, uint8_t *start, uint8_t *p, int size, int val)
static int64_t bytestream2_get_levarint(GetByteContext *gb)
static int snappy_copy2(GetByteContext *gb, uint8_t *start, uint8_t *p, int size, int val)
static int64_t decode_len(GetByteContext *gb)
static av_always_inline int bytestream2_seek(GetByteContext *g, int offset, int whence)