yaz0 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/yaz0/decompress.c +3 -2
- data/lib/yaz0/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 672cee69a6f75dd7377cf5eb17baeb36275224f98021be0a26f575488b29ea35
|
4
|
+
data.tar.gz: 7ac698b98f48d2816a2b0852e1b8937a9f6d77613b94e7e8cc81f8e7ff03df08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 488b8a8e52fc4e9d74caf1db27383cd6be5a5307c8a703b74cc3ec4c175c71bf883c1c4fc82146646ed79a53728c4d6508638914840b5ca16633a0bcbf61f97c
|
7
|
+
data.tar.gz: a06e7544dbad27a7d1647ba621d2abadea7e17cb4fed47a1fbf78e91e4fff81af56955f7423b028265bcd2b51cfadc724ff9dd79b48d72cf7dffc4103f2c0863
|
data/ext/yaz0/decompress.c
CHANGED
@@ -23,13 +23,14 @@ int yaz0Decompress(Yaz0Buffer *dst, const char *d, size_t dataLen)
|
|
23
23
|
|
24
24
|
inCursor = 0x10;
|
25
25
|
dst->data = realloc(dst->data, dstSize);
|
26
|
+
dst->capacity = dstSize;
|
26
27
|
|
27
|
-
while (inCursor < dataLen)
|
28
|
+
while (inCursor < dataLen && dst->size < dstSize)
|
28
29
|
{
|
29
30
|
group = data[inCursor++];
|
30
31
|
for (int b = 0; b < 8; ++b)
|
31
32
|
{
|
32
|
-
if (inCursor >= dataLen)
|
33
|
+
if (inCursor >= dataLen || dst->size >= dstSize)
|
33
34
|
break;
|
34
35
|
|
35
36
|
if (group & (1 << (7 - b)))
|
data/lib/yaz0/version.rb
CHANGED