1
0
Fork 0

Merging upstream version 1.10.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-20 21:26:45 +01:00
parent bfb3bc1ac4
commit 9cc5f855f8
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
26 changed files with 998 additions and 423 deletions

View file

@ -1,5 +1,5 @@
/* Lzlib - Compression library for the lzip format
Copyright (C) 2009-2017 Antonio Diaz Diaz.
Copyright (C) 2009-2018 Antonio Diaz Diaz.
This library is free software. Redistribution and use in source and
binary forms, with or without modification, are permitted provided
@ -319,11 +319,7 @@ static inline bool LZd_enough_free_bytes( const struct LZ_decoder * const d )
{ return Cb_free_bytes( &d->cb ) >= lzd_min_free_bytes; }
static inline uint8_t LZd_peek_prev( const struct LZ_decoder * const d )
{
if( d->cb.put > 0 ) return d->cb.buffer[d->cb.put-1];
if( d->pos_wrapped ) return d->cb.buffer[d->cb.buffer_size-1];
return 0; /* prev_byte of first byte */
}
{ return d->cb.buffer[((d->cb.put > 0) ? d->cb.put : d->cb.buffer_size)-1]; }
static inline uint8_t LZd_peek( const struct LZ_decoder * const d,
const unsigned distance )
@ -387,6 +383,8 @@ static inline bool LZd_init( struct LZ_decoder * const d,
d->member_finished = false;
d->verify_trailer_pending = false;
d->pos_wrapped = false;
/* prev_byte of first byte; also for LZd_peek( 0 ) on corrupt file */
d->cb.buffer[d->cb.buffer_size-1] = 0;
d->rep0 = 0;
d->rep1 = 0;
d->rep2 = 0;