33#define OUTBUF_PADDED 1
49 if (
c->in <
c->in_end)
56#define GETB(c) (*(c).in++)
58#define GETB(c) get_byte(&(c))
72 if (cnt >= INT_MAX - 1000) {
89 register const uint8_t *
src =
c->in;
90 register uint8_t *
dst =
c->out;
92 if (cnt >
c->in_end -
src) {
96 if (cnt >
c->out_end -
dst) {
100#if defined(INBUF_PADDED) && defined(OUTBUF_PADDED)
122 register uint8_t *
dst =
c->out;
124 if (
dst -
c->out_start < back) {
128 if (cnt >
c->out_end -
dst) {
141 if (*outlen <= 0 || *inlen <= 0) {
150 c.in_end = (
const uint8_t *)in + *inlen;
151 c.out =
c.out_start =
out;
152 c.out_end = (uint8_t *)
out + *outlen;
168 back = (
GETB(
c) << 3) + ((x >> 2) & 7) + 1;
172 back = (
GETB(
c) << 6) + (x >> 2) + 1;
175 back = (1 << 14) + ((x & 8) << 11);
177 back += (
GETB(
c) << 6) + (x >> 2);
178 if (back == (1 << 14)) {
191 back = (1 << 11) + (
GETB(
c) << 2) + (x >> 2) + 1;
194 back = (
GETB(
c) << 2) + (x >> 2) + 1;
202 *inlen =
c.in_end -
c.in;
205 *outlen =
c.out_end -
c.out;
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static struct @346255127015250356166251341105367306144006377143 state
#define AV_LZO_OUTPUT_FULL
decoded data did not fit into output buffer
#define AV_LZO_INPUT_DEPLETED
end of the input buffer reached before decoding finished
#define AV_LZO_INVALID_BACKPTR
a reference to previously decoded data was wrong
int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen)
Decodes LZO 1x compressed data.
#define AV_LZO_ERROR
a non-specific error in the compressed bitstream
void av_memcpy_backptr(uint8_t *dst, int back, int cnt)
Overlapping memcpy() implementation.
static int get_len(LZOContext *c, int x, int mask)
Decodes a length value in the coding used by lzo.
static void copy_backptr(LZOContext *c, int back, int cnt)
Copies previously decoded bytes to current position.
static int get_byte(LZOContext *c)
Reads one byte from the input buffer, avoiding an overrun.
static void copy(LZOContext *c, int cnt)
Copies bytes from input to output buffer with checking.
static const uint16_t mask[17]
Utility Preprocessor macros.
Memory handling functions.