check return value from zlib inflateInit2...

This commit is contained in:
iceman1001 2019-04-08 08:08:47 +02:00
commit a89ae9cb35
3 changed files with 10 additions and 4 deletions

View file

@ -206,7 +206,9 @@ int zlib_decompress(FILE *infile, FILE *outfile) {
compressed_fpga_stream.opaque = Z_NULL;
ret = inflateInit2(&compressed_fpga_stream, 0);
if ( res < 0 )
return (EXIT_FAILURE);
do {
if (compressed_fpga_stream.avail_in == 0) {
compressed_fpga_stream.next_in = inbuf;