From ac05e2f2e2c53c375dd873c39dc11e013e2a3df6 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Tue, 27 Mar 2018 00:45:18 +0800 Subject: [PATCH] Fix tail size calculation Close #381 --- native/jni/magiskboot/bootimg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/jni/magiskboot/bootimg.c b/native/jni/magiskboot/bootimg.c index 6a2dad7da..a7030c4bb 100644 --- a/native/jni/magiskboot/bootimg.c +++ b/native/jni/magiskboot/bootimg.c @@ -168,7 +168,7 @@ int parse_img(const char *image, boot_img *boot) { if (pos < boot->map_size) { boot->tail = head + pos; - boot->tail_size = boot->map_size - pos; + boot->tail_size = boot->map_size - (boot->tail - boot->map_addr); } // Check tail info, currently only for LG Bump and Samsung SEANDROIDENFORCE