aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common (follow)
AgeCommit message (Collapse)AuthorFilesLines
2008-09-06Some API cleanupsLasse Collin5-34/+42
2008-09-04Don't allow LZMA_SYNC_FLUSH with decoders anymore. There'sLasse Collin3-3/+2
simply nothing that would use it. Allow LZMA_FINISH to the decoders, which will usually ignore it (auto decoder and Stream decoder being exceptions).
2008-09-02Auto decoder cleanupLasse Collin1-1/+1
2008-09-02Updated auto decoder to handle LZMA_CONCATENATED when decodingLasse Collin1-16/+71
LZMA_Alone files. Decoding of concatenated LZMA_Alone files is intentionally not supported, so it is better to put this in auto decoder than LZMA_Alone decoder.
2008-09-02Stream decoder cleanupsLasse Collin1-25/+32
2008-08-28Sort of garbage collection commit. :-| Many things are stillLasse Collin54-1900/+1583
broken. API has changed a lot and it will still change a little more here and there. The command line tool doesn't have all the required changes to reflect the API changes, so it's easy to get "internal error" or trigger assertions.
2008-06-18Update the code to mostly match the new simpler file formatLasse Collin54-5315/+2944
specification. Simplify things by removing most of the support for known uncompressed size in most places. There are some miscellaneous changes here and there too. The API of liblzma has got many changes and still some more will be done soon. While most of the code has been updated, some things are not fixed (the command line tool will choke with invalid filter chain, if nothing else). Subblock filter is somewhat broken for now. It will be updated once the encoded format of the Subblock filter has been decided.
2008-05-11Remove support for pre-C89 libc versions that lack memcpy,Lasse Collin1-1/+1
memmove, and memset.
2008-04-28Fixed wrong spelling "limitter" to "limiter". This affectsLasse Collin2-2/+2
liblzma's API.
2008-04-25Removed src/liblzma/common/sysdefs.h symlink, which wasLasse Collin3-3/+1
annoying, because "make dist" put two copies of sysdefs.h into the tarball instead of the symlink.
2008-04-24Fix a memory leak by calling free(extra->data) inLasse Collin1-0/+1
lzma_extra_free().
2008-03-10Don't fill allocated memory with 0xFD when debugging isLasse Collin1-3/+4
enabled. It hides errors from Valgrind.
2008-02-01Do uncompressed size validation in raw encoder. This wayLasse Collin1-17/+73
it gets done for not only raw encoder, but also Block and LZMA_Alone encoders.
2008-02-01Avoid unneeded function call in raw_common.c.Lasse Collin1-9/+11
2008-01-25Combine lzma_options_block validation needed by both BlockLasse Collin3-48/+71
encoder and decoder, and put the shared things to block_private.h. Improved the checks a little so that they may detect too big Compressed Size at initialization time if lzma_options_block.total_size or .total_limit is known. Allow encoding and decoding Blocks with combinations of fields that are not allowed by the file format specification. Doing this requires that the application passes such a combination in lzma_options_lzma; liblzma doesn't do that, but it's not impossible that someone could find them useful in some custom file format.
2008-01-25Improved the memory limitter:Lasse Collin1-14/+83
- Added lzma_memlimit_max() and lzma_memlimit_reached() API functions. - Added simple estimation of malloc()'s memory usage overhead. - Fixed integer overflow detection in lzma_memlimit_alloc(). - Made some white space cleanups and added more comments. The description of lzma_memlimit_max() in memlimit.h is bad and should be improved.
2008-01-23Fix decoding of empty Metadata Blocks, that don't haveLasse Collin1-1/+3
even the Metadata Flags field. Earlier the code allowed such files; now they are prohibited as the file format specification requires.
2008-01-23Fix a bug related to 99e12af4e2b866c011fe0106cd1e0bfdcc8fe9c6.Lasse Collin1-6/+7
lzma_metadata.header_metadata_size was not properly set to zero if the Metadata had only the Metadata Flags field.
2008-01-23Fix decoding of Extra Records that have empty Data.Lasse Collin1-1/+12
2008-01-23Add the trailing '\0' to lzma_extra.data as the API headerLasse Collin1-1/+3
already documents.
2008-01-23Return LZMA_STREAM_END instead of LZMA_OK ifLasse Collin1-1/+5
LZMA_SYNC_FLUSH or LZMA_FULL_FLUSH is used when there's no unfinished Block open.
2008-01-23Fix Size of Header Metadata Block handling. NowLasse Collin3-15/+15
lzma_metadata.header_metadata_size == LZMA_VLI_VALUE_UNKNOWN is not allowed at all. To indicate missing Header Metadata Block, header_metadata_size must be set to zero. This is what Metadata decoder does after this patch too. Note that other missing fields in lzma_metadata are still indicated with LZMA_VLI_VALUE_UNKNOWN. This isn't as illogical as it sounds at first, because missing Size of Header Metadata Block means that Header Metadata Block is not present in the Stream. With other Metadata fields, a missing field means only that the value is unknown.
2008-01-23Fix a memory leak in metadata_decoder.c.Lasse Collin1-0/+1
2008-01-23Fix the fix 863028cb7ad6d8d0455fa69348f56b376d7b908f whichLasse Collin1-1/+4
just moved to problem. Now it's really fixed.
2008-01-23Take advantage of return_if_error() macro inLasse Collin1-16/+8
lzma_info_metadata_set() in info.c.
2008-01-23Fixed a dangling pointer that caused invalid free().Lasse Collin1-0/+1
2008-01-22Added lzma_easy_* functions. These should make usingLasse Collin7-2/+254
liblzma as easy as using zlib, because the easy API don't require developers to know any fancy LZMA options. Note that Multi-Block Stream encoding is currently broken. The easy API should be OK, the bug(s) are elsewhere.
2008-01-22Fix Multi-Block Stream encoder's EOPM usage.Lasse Collin1-1/+1
2008-01-22Made lzma_extra pointers const in lzma_options_stream.Lasse Collin1-2/+6
2008-01-19Revised the Delta filter implementation. The initializationLasse Collin10-200/+363
function is still shared between encoder and decoder, but the actual coding is in separate files for encoder and decoder. There are now separate functions for the actual delta calculation depending on if Delta is the last filter in the chain or not. If it is the last, the new code copies the data from input to output buffer and does the delta calculation at the same time. The old code first copied the data, then did the delta in the target buffer, which required reading through the data twice. Support for LZMA_SYNC_FLUSH was added to the Delta encoder. This doesn't change anything in the file format.
2008-01-16Plugged a memory leak in stream_decoder.c.Lasse Collin1-0/+20
2008-01-16Added lzma_memlimit_count().Lasse Collin1-0/+19
2008-01-16Make Uncompresed Size validation more strictLasse Collin1-1/+2
in alone_decoder.c.
2008-01-15Use fastpos.h when encoding LZMA dictionary size inLasse Collin1-21/+19
Filter Flags encoder.
2008-01-15Revised the fastpos code. It now uses the slightly fasterLasse Collin1-3/+0
table-based version from LZMA SDK 4.57. This should be fast on most systems. A simpler and smaller alternative version is also provided. On some CPUs this can be even a little faster than the default table-based version (see comments in fastpos.h), but on most systems the table-based code is faster.
2008-01-15Added bsr.h.Lasse Collin2-0/+62
2008-01-15Fix CRC code in case --enable-small is used.Lasse Collin2-4/+0
2008-01-15Added precomputed range coder probability price table.Lasse Collin1-2/+3
2008-01-14Small LZMA_SYNC_FLUSH fixes to Block and Single-Stream encoders.Lasse Collin2-2/+3
2008-01-08Take advantage of return_if_error() in block_decoder.c.Lasse Collin1-16/+7
2008-01-08Fix decoding of Blocks that have only Block Header.Lasse Collin1-23/+14
2008-01-08Fixed encoding of empty files. Arguments to is_size_valid()Lasse Collin1-1/+1
were in wrong order in block_encoder.c.
2007-12-11Removed uncompressed size tracking from Delta encoder too.Lasse Collin1-18/+3
2007-12-11Remove uncompressed size tracking from the filter encoders.Lasse Collin1-23/+2
It's not strictly needed there, and just complicates the code. LZ encoder never even had this feature. The primary reason to have uncompressed size tracking in filter encoders was validating that the application doesn't give different amount of input that it had promised. A side effect was to validate internal workings of liblzma. Uncompressed size tracking is still present in the Block encoder. Maybe it should be added to LZMA_Alone and raw encoders too. It's simpler to have one coder just to validate the uncompressed size instead of having it in every filter.
2007-12-09Added LZMA_SYNC_FLUSH support to the Copy filter.Lasse Collin1-35/+57
2007-12-09Take advantage of return_if_error() macro in more places.Lasse Collin5-84/+39
Cleaned Subblock filter's initialization code too.
2007-12-09Imported to git.Lasse Collin56-0/+8851