Gitweb links:

...log 
http://git.netsurf-browser.org/makerun.git/shortlog/fe55b6bfda74b0398eaa141faec44df4af8f8f16
...commit 
http://git.netsurf-browser.org/makerun.git/commit/fe55b6bfda74b0398eaa141faec44df4af8f8f16
...tree 
http://git.netsurf-browser.org/makerun.git/tree/fe55b6bfda74b0398eaa141faec44df4af8f8f16

The branch, master has been updated
       via  fe55b6bfda74b0398eaa141faec44df4af8f8f16 (commit)
      from  dc839346e8a2032d0fe318b5c098af8e6e0cd76e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/makerun.git/commit/?id=fe55b6bfda74b0398eaa141faec44df4af8f8f16
commit fe55b6bfda74b0398eaa141faec44df4af8f8f16
Author: John-Mark Bell <[email protected]>
Commit: John-Mark Bell <[email protected]>

    Fix squeezed relocateable image support

diff --git a/makerun.c b/makerun.c
index 48b1d1e..435e63a 100644
--- a/makerun.c
+++ b/makerun.c
@@ -113,9 +113,17 @@ int main(int argc, char **argv)
                        return 1;
                }
 
+               /* Squeeze always processes pairs of words at a time,
+                * so the declared decompressed size will always be
+                * rounded up to an 8-byte boundary. We will need to
+                * adjust expected_size to account for this but, if
+                * the image is also relocateable, the file size will
+                * be modified instead as a result of discarding the
+                * relocation code and tables from the end of the
+                * image. Therefore, we'll defer the expected_size
+                * adjustment until later.
+                */
                file_size = sizeof(header) + (size_t) sqzhdr.decsize;
-               /* Round expected size up to an even number of words */
-               expected_size = (expected_size + 7) & ~7;
        }
 
        fclose(f);
@@ -144,6 +152,11 @@ int main(int argc, char **argv)
                        file_size -= reloc_size;
                        /* Add relocation workspace on to reloc size */
                        reloc_size += header.wkspace;
+               } else if ((header.decompress >> 24) == 0xEB) {
+                       /* Image is compressed, but not relocateable */
+                       /* Round expected size up to an even number of words
+                        * (see above for details) */
+                       expected_size = (expected_size + 7) & ~7;
                }
 
                if (file_size != expected_size) {


-----------------------------------------------------------------------

Summary of changes:
 makerun.c |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/makerun.c b/makerun.c
index 48b1d1e..435e63a 100644
--- a/makerun.c
+++ b/makerun.c
@@ -113,9 +113,17 @@ int main(int argc, char **argv)
                        return 1;
                }
 
+               /* Squeeze always processes pairs of words at a time,
+                * so the declared decompressed size will always be
+                * rounded up to an 8-byte boundary. We will need to
+                * adjust expected_size to account for this but, if
+                * the image is also relocateable, the file size will
+                * be modified instead as a result of discarding the
+                * relocation code and tables from the end of the
+                * image. Therefore, we'll defer the expected_size
+                * adjustment until later.
+                */
                file_size = sizeof(header) + (size_t) sqzhdr.decsize;
-               /* Round expected size up to an even number of words */
-               expected_size = (expected_size + 7) & ~7;
        }
 
        fclose(f);
@@ -144,6 +152,11 @@ int main(int argc, char **argv)
                        file_size -= reloc_size;
                        /* Add relocation workspace on to reloc size */
                        reloc_size += header.wkspace;
+               } else if ((header.decompress >> 24) == 0xEB) {
+                       /* Image is compressed, but not relocateable */
+                       /* Round expected size up to an even number of words
+                        * (see above for details) */
+                       expected_size = (expected_size + 7) & ~7;
                }
 
                if (file_size != expected_size) {


-- 
WimpSlot calculator for NetSurf
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to