@@ -727,7 +727,7 @@ void CompressedInputStream::close()
727727 // Force subsequent reads to trigger submitBlock immediately
728728 _bufferThreshold = 0 ;
729729
730- // Buffer cleanup: force error on any subsequent write attempt
730+ // Buffer cleanup: force error on any subsequent read attempt
731731 for (int i = 0 ; i < 2 * _jobs; i++) {
732732 if (_buffers[i]->_array != nullptr )
733733 delete[] _buffers[i]->_array ;
@@ -773,6 +773,9 @@ template <class T>
773773T DecodingTask<T>::run()
774774{
775775 int blockId = _ctx.getInt (" blockId" );
776+ bool streamPerTask = _ctx.getInt (" tasks" ) > 1 ;
777+ uint64 tType = _ctx.getLong (" tType" );
778+ short eType = short (_ctx.getInt (" eType" ));
776779
777780 // Lock free synchronization
778781 while (true ) {
@@ -794,9 +797,6 @@ T DecodingTask<T>::run()
794797 EntropyDecoder* ed = nullptr ;
795798 InputBitStream* ibs = nullptr ;
796799 TransformSequence<byte>* transform = nullptr ;
797- bool streamPerTask = _ctx.getInt (" tasks" ) > 1 ;
798- uint64 tType = _ctx.getLong (" tType" );
799- short eType = short (_ctx.getInt (" eType" ));
800800
801801 try {
802802 // Read shared bitstream sequentially (each task is gated by _processedBlockId)
@@ -816,11 +816,11 @@ T DecodingTask<T>::run()
816816 return T (*_data, blockId, 0 , 0 , Error::ERR_BLOCK_SIZE, " Invalid block size" );
817817 }
818818
819- const int r = int ((read + 7 ) >> 3 );
819+ const uint r = uint ((read + 7 ) >> 3 );
820820
821821 if (streamPerTask == true ) {
822- if (_data->_length < max (_blockLength, r)) {
823- _data->_length = max (_blockLength, r);
822+ if (_data->_length < int ( max (_blockLength, r) )) {
823+ _data->_length = int ( max (_blockLength, r) );
824824 delete[] _data->_array ;
825825 _data->_array = new byte[_data->_length ];
826826 }
@@ -871,7 +871,8 @@ T DecodingTask<T>::run()
871871 const int length = dataSize << 3 ;
872872 const uint64 mask = (uint64 (1 ) << length) - 1 ;
873873 const int preTransformLength = int (ibs->readBits (length) & mask);
874- const int maxTransformSize = min (max (_blockLength + _blockLength / 2 , 2048 ), CompressedInputStream::MAX_BITSTREAM_BLOCK_SIZE);
874+ const int maxTransformSize = int (min (max (_blockLength + _blockLength / 2 , 2048u ),
875+ uint (CompressedInputStream::MAX_BITSTREAM_BLOCK_SIZE)));
875876
876877 if ((preTransformLength <= 0 ) || (preTransformLength > maxTransformSize)) {
877878 // Error => cancel concurrent decoding tasks
@@ -911,7 +912,7 @@ T DecodingTask<T>::run()
911912 CompressedInputStream::notifyListeners (_listeners, evt2);
912913 }
913914
914- const int bufferSize = max (_blockLength, preTransformLength + CompressedInputStream::EXTRA_BUFFER_SIZE);
915+ const int bufferSize = max (int ( _blockLength) , preTransformLength + CompressedInputStream::EXTRA_BUFFER_SIZE);
915916
916917 if (_buffer->_length < bufferSize) {
917918 _buffer->_length = bufferSize;
0 commit comments