diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-10-29 05:29:00 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-10-29 05:29:00 +0000 |
commit | 9ea4601ed9ebfcfc5e21a86e743c8886e5ebc4c3 (patch) | |
tree | b9df76895e5a773b0f92b09b1b37bdc852698c6b | |
parent | 9906ffe3c54875133448134c09ec12a0949d48cd (diff) | |
download | libbu++-9ea4601ed9ebfcfc5e21a86e743c8886e5ebc4c3.tar.gz libbu++-9ea4601ed9ebfcfc5e21a86e743c8886e5ebc4c3.tar.bz2 libbu++-9ea4601ed9ebfcfc5e21a86e743c8886e5ebc4c3.tar.xz libbu++-9ea4601ed9ebfcfc5e21a86e743c8886e5ebc4c3.zip |
zlib can't really handle empty buffers, so we don't pass empty buffers to it
now, even if the function parameters indicate that.
Diffstat (limited to '')
-rw-r--r-- | src/deflate.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/deflate.cpp b/src/deflate.cpp index 2d925a7..704d172 100644 --- a/src/deflate.cpp +++ b/src/deflate.cpp | |||
@@ -123,6 +123,8 @@ void Bu::Deflate::zError( int code ) | |||
123 | Bu::size Bu::Deflate::read( void *pData, Bu::size nBytes ) | 123 | Bu::size Bu::Deflate::read( void *pData, Bu::size nBytes ) |
124 | { | 124 | { |
125 | TRACE( pData, nBytes ); | 125 | TRACE( pData, nBytes ); |
126 | if( nBytes <= 0 ) | ||
127 | return 0; | ||
126 | if( !pState->state ) | 128 | if( !pState->state ) |
127 | { | 129 | { |
128 | bReading = true; | 130 | bReading = true; |
@@ -191,6 +193,8 @@ Bu::size Bu::Deflate::read( void *pData, Bu::size nBytes ) | |||
191 | Bu::size Bu::Deflate::write( const void *pData, Bu::size nBytes ) | 193 | Bu::size Bu::Deflate::write( const void *pData, Bu::size nBytes ) |
192 | { | 194 | { |
193 | TRACE( pData, nBytes ); | 195 | TRACE( pData, nBytes ); |
196 | if( nBytes <= 0 ) | ||
197 | return 0; | ||
194 | if( !pState->state ) | 198 | if( !pState->state ) |
195 | { | 199 | { |
196 | bReading = false; | 200 | bReading = false; |