tgunzip: Call uzlib_uncompress_init before any other ops on TINF_DATA
uzlib_uncompress_init() should be called first before setting any other fields or running uzlib_gzip_parse_header().
This commit is contained in:
parent
6a47a55685
commit
1aa2b1161e
1 changed files with 3 additions and 3 deletions
|
|
@ -105,6 +105,9 @@ int main(int argc, char *argv[])
|
|||
outlen = dlen;
|
||||
|
||||
TINF_DATA d;
|
||||
// uzlib_uncompress_init(&d, malloc(32768), 32768);
|
||||
uzlib_uncompress_init(&d, NULL, 0);
|
||||
|
||||
d.source = source;
|
||||
|
||||
res = uzlib_gzip_parse_header(&d);
|
||||
|
|
@ -113,9 +116,6 @@ int main(int argc, char *argv[])
|
|||
exit(1);
|
||||
}
|
||||
|
||||
// uzlib_uncompress_init(&d, malloc(32768), 32768);
|
||||
uzlib_uncompress_init(&d, NULL, 0);
|
||||
|
||||
d.dest = dest;
|
||||
/* decompress byte by byte; can be any other length */
|
||||
d.destSize = 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue