summaryrefslogtreecommitdiffstats
path: root/decoder.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 13:38:24 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 13:38:24 +0000
commitea3af4362a8e6a6f6fb44d001336e0c31d46134c (patch)
tree64b34493522b36c1d86b0fe63e0d855e1d424071 /decoder.cc
parentAdding upstream version 0.8. (diff)
downloadlzlib-ea3af4362a8e6a6f6fb44d001336e0c31d46134c.tar.xz
lzlib-ea3af4362a8e6a6f6fb44d001336e0c31d46134c.zip
Adding upstream version 0.9.upstream/0.9
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'decoder.cc')
-rw-r--r--decoder.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/decoder.cc b/decoder.cc
index 2577230..429d33e 100644
--- a/decoder.cc
+++ b/decoder.cc
@@ -44,6 +44,7 @@ const CRC32 crc32;
// Returns the number of bytes copied.
int Circular_buffer::read_data( uint8_t * const out_buffer, const int out_size ) throw()
{
+ if( out_size < 0 ) return 0;
int size = 0;
if( get > put )
{
@@ -73,6 +74,7 @@ int Circular_buffer::read_data( uint8_t * const out_buffer, const int out_size )
// Returns the number of bytes copied.
int Circular_buffer::write_data( const uint8_t * const in_buffer, const int in_size ) throw()
{
+ if( in_size < 0 ) return 0;
int size = 0;
if( put >= get )
{