From c88c91fa8e5ae41a0201053ac4a46a722344b758 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 11 May 2017 15:18:00 +0100 Subject: intel_error_decode: Tell zlib the correct amount of memory we allocated Signed-off-by: Chris Wilson --- tools/intel_error_decode.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tools/intel_error_decode.c') diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c index 6d07ce88..2cbdd887 100644 --- a/tools/intel_error_decode.c +++ b/tools/intel_error_decode.c @@ -482,7 +482,7 @@ static int zlib_inflate(uint32_t **ptr, int len) out = malloc(128*4096); /* approximate obj size */ zstream.next_out = out; - zstream.avail_out = 40*len; + zstream.avail_out = 128*4096; do { switch (inflate(&zstream, Z_SYNC_FLUSH)) { @@ -576,10 +576,9 @@ read_data_file(FILE *file) if (line[0] == ':' || line[0] == '~') { count = ascii85_decode(line+1, &data, line[0] == ':'); - if (count == 0) { - fprintf(stderr, "ASCII85 decode failed.\n"); - exit(1); - } + if (count == 0) + fprintf(stderr, "ASCII85 decode failed (%s - %s).\n", + ring_name, buffer_name); decode(decode_ctx, buffer_name, ring_name, gtt_offset, head_offset, -- cgit v1.2.3