Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
noVNC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
noVNC
Commits
b0ac240f
Commit
b0ac240f
authored
13 years ago
by
Mike Tinglof
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re-enable history buffer (used as sliding window for decompress)
parent
0fa6748c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
jsunzip.js
include/jsunzip.js
+5
-6
No files found.
include/jsunzip.js
View file @
b0ac240f
...
...
@@ -198,7 +198,7 @@ function JSUnzip() {
*/
"use strict"
;
function
TINF
()
{
this
.
OK
=
0
;
...
...
@@ -502,16 +502,16 @@ this.inflate_block_data = function(d, lt, dt)
dist
=
this
.
decode_symbol
(
d
,
dt
);
/* possibly get more bits from distance code */
offs
=
d
dest
length
-
this
.
read_bits
(
d
,
this
.
dist_bits
[
dist
],
this
.
dist_base
[
dist
]);
offs
=
d
.
history
.
length
-
this
.
read_bits
(
d
,
this
.
dist_bits
[
dist
],
this
.
dist_base
[
dist
]);
if
(
offs
<
0
)
throw
(
"Invalid zlib offset "
+
offs
);
/* copy match */
for
(
i
=
offs
;
i
<
offs
+
length
;
++
i
)
{
ddest
[
ddestlength
++
]
=
ddest
[
i
];
//
ddest[ddestlength++] = d.history[i];
//
d.history.push(d.history[i]);
//
ddest[ddestlength++] = ddest[i];
ddest
[
ddestlength
++
]
=
d
.
history
[
i
];
d
.
history
.
push
(
d
.
history
[
i
]);
}
}
}
...
...
@@ -657,7 +657,6 @@ this.uncompress = function(source, offset)
}
while
(
!
bfinal
&&
d
.
sourceIndex
<
d
.
source
.
length
);
//d.history.push.apply(d.history, d.dest);
d
.
history
=
d
.
history
.
slice
(
-
this
.
WINDOW_SIZE
);
return
{
'status'
:
this
.
OK
,
'data'
:
d
.
dest
};
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment