From f962d0da66bff62e7d9ada9936afc4791d24da00 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 7 Jul 2020 12:31:52 +0200 Subject: [PATCH] =?UTF-8?q?Bug=20fix:=20Big-Endian=20MIPS=20Volume=20Heade?= =?UTF-8?q?r=20boot=20file=20size=20was=20rounded=20up=20to=20full=202048.?= =?UTF-8?q?=20Thanks=20Ren=C3=A9=20Rebe.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libisofs/system_area.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libisofs/system_area.c b/libisofs/system_area.c index 5d143ec..83f0df9 100644 --- a/libisofs/system_area.c +++ b/libisofs/system_area.c @@ -555,9 +555,12 @@ static int make_mips_volume_header(Ecma119Image *t, uint8_t *buf, int flag) stream = iso_file_get_stream((IsoFile *) node); file_size = iso_stream_get_size(stream); - /* Shall i really round up to 2048 ? Steve says yes.*/ - iso_msb(buf + (72 + 16 * idx) + 12, - ((file_size + 2047) / 2048 ) * 2048, 4); + /* genisoimage rounds up to full multiples of 2048. + libisofs did this too until 2020, but the arcload mips boot loader + throws error if the rounded size is stored here. + So now the exact bytecount gets stored. + */ + iso_msb(buf + (72 + 16 * idx) + 12, file_size, 4); }