Gitweb links:

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

The branch, master has been updated
       via  dc839346e8a2032d0fe318b5c098af8e6e0cd76e (commit)
      from  a6a833a50b3287e6c719d9d5d54f909a894ebaa1 (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=dc839346e8a2032d0fe318b5c098af8e6e0cd76e
commit dc839346e8a2032d0fe318b5c098af8e6e0cd76e
Author: John-Mark Bell <[email protected]>
Commit: John-Mark Bell <[email protected]>

    Fix squeezed binary support
    
    It turns out that the squeeze algorithm will always round the
    uncompressed input data up to a multiple of 8 bytes before
    compressing it. Update our expected size logic to reflect this.

diff --git a/makerun.c b/makerun.c
index 5008b1b..48b1d1e 100644
--- a/makerun.c
+++ b/makerun.c
@@ -41,7 +41,7 @@ int main(int argc, char **argv)
        FILE *f, *g;
        struct header header;
        long flen;
-       size_t file_size, reloc_size = 0;
+       size_t file_size, reloc_size = 0, expected_size = 0;
        char buf[256];
 
        if (argc != 4) {
@@ -70,6 +70,7 @@ int main(int argc, char **argv)
                fclose(f);
                return 1;
        }
+       expected_size = header.rosize + header.rwsize + header.dbsize;
 
        if ((header.decompress >> 24) == 0xEB) {
                /* Image is compressed */
@@ -113,6 +114,8 @@ int main(int argc, char **argv)
                }
 
                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);
@@ -143,8 +146,7 @@ int main(int argc, char **argv)
                        reloc_size += header.wkspace;
                }
 
-               if (header.rosize + header.rwsize + header.dbsize !=
-                               file_size) {
+               if (file_size != expected_size) {
                        fprintf(stderr, "Mismatched field sizes\n");
                        return 1;
                }


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

Summary of changes:
 makerun.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/makerun.c b/makerun.c
index 5008b1b..48b1d1e 100644
--- a/makerun.c
+++ b/makerun.c
@@ -41,7 +41,7 @@ int main(int argc, char **argv)
        FILE *f, *g;
        struct header header;
        long flen;
-       size_t file_size, reloc_size = 0;
+       size_t file_size, reloc_size = 0, expected_size = 0;
        char buf[256];
 
        if (argc != 4) {
@@ -70,6 +70,7 @@ int main(int argc, char **argv)
                fclose(f);
                return 1;
        }
+       expected_size = header.rosize + header.rwsize + header.dbsize;
 
        if ((header.decompress >> 24) == 0xEB) {
                /* Image is compressed */
@@ -113,6 +114,8 @@ int main(int argc, char **argv)
                }
 
                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);
@@ -143,8 +146,7 @@ int main(int argc, char **argv)
                        reloc_size += header.wkspace;
                }
 
-               if (header.rosize + header.rwsize + header.dbsize !=
-                               file_size) {
+               if (file_size != expected_size) {
                        fprintf(stderr, "Mismatched field sizes\n");
                        return 1;
                }


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

Reply via email to