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:
Paul Sokolovsky 2018-07-07 00:26:40 +03:00
parent 6a47a55685
commit 1aa2b1161e

View file

@ -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;