summaryrefslogtreecommitdiffstats
path: root/lzlib.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 13:34:37 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 13:34:37 +0000
commitf8840edb77f083c1d3a653bb4edb0490d53eab2c (patch)
tree58a545983dd1903ff2d42afd35d1d60c989c5ccf /lzlib.cc
parentAdding debian version 0.4-1. (diff)
downloadlzlib-f8840edb77f083c1d3a653bb4edb0490d53eab2c.tar.xz
lzlib-f8840edb77f083c1d3a653bb4edb0490d53eab2c.zip
Merging upstream version 0.5.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'lzlib.cc')
-rw-r--r--lzlib.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/lzlib.cc b/lzlib.cc
index c64ed43..76212db 100644
--- a/lzlib.cc
+++ b/lzlib.cc
@@ -335,7 +335,7 @@ int LZ_decompress_read( void * const decoder, uint8_t * const buffer,
if( d.ibuf->used_bytes() < 5 + (int)sizeof( File_header ) )
{
if( !d.ibuf->at_stream_end() || d.ibuf->finished() ) return 0;
- d.ibuf->purge();
+ d.ibuf->purge(); // remove trailing garbage
d.lz_errno = LZ_header_error;
return -1;
}
@@ -346,12 +346,12 @@ int LZ_decompress_read( void * const decoder, uint8_t * const buffer,
header.dictionary_size() < min_dictionary_size ||
header.dictionary_size() > max_dictionary_size )
{
- d.ibuf->purge();
+ d.ibuf->purge(); // remove trailing garbage
d.lz_errno = LZ_header_error;
return -1;
}
try { d.lz_decoder = new LZ_decoder( header, *d.ibuf ); }
- catch( std::bad_alloc )
+ catch( std::bad_alloc ) // not enough free memory
{
d.ibuf->purge();
d.lz_decoder = 0;