diff --git a/www/index.html b/www/index.html
index 4d559967..640594b1 100644
--- a/www/index.html
+++ b/www/index.html
@@ -455,14 +455,16 @@
Main libraries and resources used:
- - jQuery 3, released under the MIT licence
- - Bootstrap 3, released under the Apache licence 2.0, which includes icons from Glyphicons
- - RequireJS 2, released under the MIT licence or new BSD licence
- - QUnit 2, released under the MIT licence
- - Kiwix logo from kiwix.org, released under the Creative Commons Attribution Share Alike
- - OpenZIM specifications from www.openzim.org, released under the Creative Commons Attribution Share Alike
- - Emscripten to generate a XZ decompressor in javascript : https://github.com/kripken/emscripten, released under the MIT licence
+ - jQuery 3, released under the MIT Licence
+ - Bootstrap 3, released under the Apache Licence 2.0, which includes icons from Glyphicons
+ - RequireJS 2, released under the MIT licence or new BSD Licence
+ - QUnit 2, released under the MIT Licence
+ - Kiwix logo from kiwix.org, released under the Creative Commons Attribution Share Alike Licence
+ - OpenZIM specifications from www.openzim.org, released under the Creative Commons Attribution Share Alike Licence
+ - Emscripten to generate a XZ decompressor in javascript : https://github.com/kripken/emscripten, released under the MIT Licence
- XZ Embedded (the XZ library converted to Javascript with Emscripten), in public domain
+ - The Zstandard library, released under a BSD Licence and a GPLv2 Copying Licence
+
- KaTeX for typesetting mathematical and chemical equations, released under the MIT licence
- Hilitor for finding and hilighting text inside an article, released under this licence
diff --git a/www/js/lib/zimfile.js b/www/js/lib/zimfile.js
index a92c4601..0551d659 100644
--- a/www/js/lib/zimfile.js
+++ b/www/js/lib/zimfile.js
@@ -191,10 +191,7 @@ define(['xzdec_wrapper', 'zstddec_wrapper', 'util', 'utf8', 'q', 'zimDirEntry'],
return that._readSlice(clusterOffset, 1).then(function(compressionType) {
var decompressor;
var plainBlobReader = function(offset, size) {
- // DEV: old algorithm merely returned requested data size
- // but I believe we need to check that we are not reading beyond the end of the cluster
- // Is this an oversight in original code or an unnecessary protection?
- // return that._readSlice(clusterOffset + 1 + offset, size);
+ // Check that we are not reading beyond the end of the cluster
var offsetStart = clusterOffset + 1 + offset;
if ( offsetStart < nextCluster) {
// Gratuitous parentheses added for legibility
diff --git a/www/js/lib/zstddec_wrapper.js b/www/js/lib/zstddec_wrapper.js
index 1fd90da3..ec40014c 100644
--- a/www/js/lib/zstddec_wrapper.js
+++ b/www/js/lib/zstddec_wrapper.js
@@ -48,9 +48,10 @@ define(['q', 'zstddec'], function(Q) {
// Get a permanent decoder handle (pointer to control structure)
// NB there is no need to change this handle even between ZIM loads: zstddeclib encourages re-using assigned structures
zd._decHandle = zd._ZSTD_createDStream();
- // DEV set chunkSize according to memory environment; for systems with plenty of memory,
- // zd can provide a max recommended size with
+ // In-built function below provides a max recommended chunk size
zd._chunkSize = zd._ZSTD_DStreamInSize();
+ // Change _chunkSize if you need a more conservative memory environment, but you may need to experiment with INITIAL_MEMORY
+ // in zstddec.js (see below) for this to make any difference
// zd._chunkSize = 5 * 1024;
// Initialize inBuffer
@@ -259,4 +260,4 @@ define(['q', 'zstddec'], function(Q) {
return {
Decompressor: Decompressor
};
-});
+});
\ No newline at end of file