diff --git a/boot/image.c b/boot/image.c
index 07fa2d3160d6aa6a3b676e418fe91bbe5b902aa5..121df0c83842660f3bcc47bf3ca032ba7c3eeb54 100644
--- a/boot/image.c
+++ b/boot/image.c
@@ -500,7 +500,7 @@ int image_decomp(int comp, ulong load, ulong image_start, int type,
 			struct abuf in, out;
 
 			abuf_init_set(&in, image_buf, image_len);
-			abuf_init_set(&in, load_buf, unc_len);
+			abuf_init_set(&out, load_buf, unc_len);
 			ret = zstd_decompress(&in, &out);
 			if (ret >= 0) {
 				image_len = ret;