summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--boot/bootm.c4
-rw-r--r--lib/gunzip.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/boot/bootm.c b/boot/bootm.c
index f5cbb10f0d1..f6aa32746b7 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -34,6 +34,7 @@
#include <bootm.h>
#include <image.h>
+#include <u-boot/zlib.h>
#define MAX_CMDLINE_SIZE SZ_4K
@@ -578,7 +579,8 @@ static int handle_decomp_error(int comp_type, size_t uncomp_size,
if (ret == -ENOSYS)
return BOOTM_ERR_UNIMPLEMENTED;
- if (uncomp_size >= buf_size)
+ if ((comp_type == IH_COMP_GZIP && ret == Z_BUF_ERROR) ||
+ uncomp_size >= buf_size)
printf("Image too large: increase CONFIG_SYS_BOOTM_LEN\n");
else
printf("%s: uncompress error %d\n", name, ret);
diff --git a/lib/gunzip.c b/lib/gunzip.c
index 52007715bda..a05dcde9a75 100644
--- a/lib/gunzip.c
+++ b/lib/gunzip.c
@@ -299,7 +299,7 @@ __rcode int zunzip(void *dst, int dstlen, unsigned char *src,
if (stoponerr == 1 && r != Z_STREAM_END &&
(s.avail_in == 0 || s.avail_out == 0 || r != Z_BUF_ERROR)) {
printf("Error: inflate() returned %d\n", r);
- err = -1;
+ err = r;
break;
}
} while (r == Z_BUF_ERROR);