From fe94d7915b947b3ef2db65b644b1d132d3f066cb Mon Sep 17 00:00:00 2001 From: IgorA Date: Fri, 11 Nov 2016 16:57:56 +0000 Subject: [PATCH] fix input limit 64 Kb git-svn-id: svn://kolibrios.org@6704 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/fs/kfar/trunk/zlib/deflate.asm | 16 ++++++++-------- programs/fs/kfar/trunk/zlib/example1.asm | 2 +- programs/fs/kfar/trunk/zlib/zlib.inc | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/programs/fs/kfar/trunk/zlib/deflate.asm b/programs/fs/kfar/trunk/zlib/deflate.asm index b4a576503b..8dd36a9978 100644 --- a/programs/fs/kfar/trunk/zlib/deflate.asm +++ b/programs/fs/kfar/trunk/zlib/deflate.asm @@ -943,7 +943,7 @@ zlib_debug 'deflate strm = %d',ebx je .beg0 cmp dword[ebx+z_stream.next_in],Z_NULL jne @f - cmp word[ebx+z_stream.avail_in],0 + cmp dword[ebx+z_stream.avail_in],0 jne .beg0 @@: cmp dword[edi+deflate_state.status],FINISH_STATE @@ -1338,7 +1338,7 @@ end if ; returning Z_STREAM_END instead of Z_BUF_ERROR. jmp @f .end13: - cmp word[ebx+z_stream.avail_in],0 + cmp dword[ebx+z_stream.avail_in],0 jne @f RANK dword[old_flush],esi RANK dword[flush],eax @@ -1353,7 +1353,7 @@ end if ; User must not provide more input after the first FINISH: cmp dword[edi+deflate_state.status],FINISH_STATE jne @f - cmp word[ebx+z_stream.avail_in],0 + cmp dword[ebx+z_stream.avail_in],0 je @f ;if (..==.. && ..!=0) ERR_RETURN ebx, Z_BUF_ERROR jmp .end_f @@ -1361,7 +1361,7 @@ end if ; Start a new block or continue the current one. - cmp word[ebx+z_stream.avail_in],0 + cmp dword[ebx+z_stream.avail_in],0 jne @f cmp dword[edi+deflate_state.lookahead],0 jne @f @@ -1662,7 +1662,7 @@ endp align 4 proc read_buf uses ebx ecx, strm:dword, buf:dword, size:dword mov ebx,[strm] - movzx eax,word[ebx+z_stream.avail_in] + mov eax,[ebx+z_stream.avail_in] cmp eax,[size] jle @f ;if (..>..) @@ -1674,7 +1674,7 @@ proc read_buf uses ebx ecx, strm:dword, buf:dword, size:dword jmp .end_f ;if (..==0) return 0 @@: - sub [ebx+z_stream.avail_in],ax + sub [ebx+z_stream.avail_in],eax stdcall zmemcpy, [buf],[ebx+z_stream.next_in],eax mov ecx,[ebx+z_stream.state] @@ -2078,7 +2078,7 @@ end if pop ecx ebx add ebx,ecx .end0: - cmp word[edx+z_stream.avail_in],0 + cmp dword[edx+z_stream.avail_in],0 je .cycle0end ;if (..==0) break ; If there was no sliding: @@ -2157,7 +2157,7 @@ end if cmp dword[edi+deflate_state.lookahead],MIN_LOOKAHEAD jge .cycle0end - cmp word[edx+z_stream.avail_in],0 + cmp dword[edx+z_stream.avail_in],0 jne .cycle0 .cycle0end: ;while (..<.. && ..!=..) diff --git a/programs/fs/kfar/trunk/zlib/example1.asm b/programs/fs/kfar/trunk/zlib/example1.asm index a37ac223bf..7264926621 100644 --- a/programs/fs/kfar/trunk/zlib/example1.asm +++ b/programs/fs/kfar/trunk/zlib/example1.asm @@ -162,7 +162,7 @@ test_code: mov eax,my_strm mov [eax+z_stream.next_in],m0 ;устанавливаем память для сжатия mov ecx,[m0size] - mov word[eax+z_stream.avail_in],cx ;размер сжимаемыж данных + mov [eax+z_stream.avail_in],ecx ;размер сжимаемыж данных mov [eax+z_stream.next_out],m1 ;устанавливаем буфер для сжатия mov word[eax+z_stream.avail_out],1024 ;размер буфера для сжатия (максимум 16 Кб) diff --git a/programs/fs/kfar/trunk/zlib/zlib.inc b/programs/fs/kfar/trunk/zlib/zlib.inc index 4038c40f09..e0e5eb2b5a 100644 --- a/programs/fs/kfar/trunk/zlib/zlib.inc +++ b/programs/fs/kfar/trunk/zlib/zlib.inc @@ -72,7 +72,7 @@ ZLIB_VER_SUBREVISION equ 0 struct z_stream ;z_stream_s next_in dd ? ;z_const Bytef * ;next input byte - avail_in dw ? ;uInt ;number of bytes available at next_in + avail_in dd ? ;uInt ;number of bytes available at next_in total_in dd ? ;uLong ;total number of input bytes read so far next_out dd ? ;Bytef * ;next output byte should be put there