diff --git a/common/image-android.c b/common/image-android.c index 03b0032a99..0aa79a7fb5 100644 --- a/common/image-android.c +++ b/common/image-android.c @@ -374,6 +374,9 @@ static int image_read(img_t img, struct andr_img_hdr *hdr, return -ENOMEM; } + if (!blksz || !datasz) + goto crypto_calc; + /* load */ if (ram_base) { memcpy(ramdst, (char *)((ulong)ram_base + offset), datasz); @@ -386,6 +389,7 @@ static int image_read(img_t img, struct andr_img_hdr *hdr, } } +crypto_calc: /* sha1 */ #ifdef CONFIG_DM_CRYPTO if (crypto) {