Gitweb links:

...log 
http://git.netsurf-browser.org/libnsbmp.git/shortlog/4494e2a9dad4f1e837e488cecebcedaeb0ef7b39
...commit 
http://git.netsurf-browser.org/libnsbmp.git/commit/4494e2a9dad4f1e837e488cecebcedaeb0ef7b39
...tree 
http://git.netsurf-browser.org/libnsbmp.git/tree/4494e2a9dad4f1e837e488cecebcedaeb0ef7b39

The branch, master has been updated
       via  4494e2a9dad4f1e837e488cecebcedaeb0ef7b39 (commit)
      from  2aa1b546f308c1e504b383e163411732b17fb299 (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/libnsbmp.git/commit/?id=4494e2a9dad4f1e837e488cecebcedaeb0ef7b39
commit 4494e2a9dad4f1e837e488cecebcedaeb0ef7b39
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    Further quietening of scan-build
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/src/libnsbmp.c b/src/libnsbmp.c
index 760ac91..f6ebd6c 100644
--- a/src/libnsbmp.c
+++ b/src/libnsbmp.c
@@ -325,11 +325,11 @@ static bmp_result bmp_info_header_parse(bmp_image *bmp, 
uint8_t *data)
                 if (!bmp->colour_table)
                         return BMP_INSUFFICIENT_MEMORY;
                 for (i = 0; i < bmp->colours; i++) {
-                        bmp->colour_table[i] = data[2] | (data[1] << 8) | 
(data[0] << 16);
+                        uint32_t colour = data[2] | (data[1] << 8) | (data[0] 
<< 16);
                         if (bmp->opaque)
-                                bmp->colour_table[i] |= ((uint32_t)0xff << 24);
+                                colour |= ((uint32_t)0xff << 24);
                         data += palette_size;
-                        bmp->colour_table[i] = read_uint32((uint8_t 
*)&bmp->colour_table[i],0);
+                        bmp->colour_table[i] = read_uint32((uint8_t 
*)&colour,0);
                 }
 
                 /* some bitmaps have a bad offset if there is a pallete, work
@@ -771,7 +771,7 @@ static bmp_result bmp_decode_rgb(bmp_image *bmp, uint8_t 
**start, int bytes)
         uint8_t cur_byte = 0, bit, i;
 
         /* Belt and braces, we shouldn't get here unless this holds */
-        assert(bmp->bpp > 0 && bmp->bpp <= 8);
+        assert(ppb >= 1);
 
         for (i = 0; i < ppb; i++)
                 bit_shifts[i] = 8 - ((i + 1) * bmp->bpp);


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

Summary of changes:
 src/libnsbmp.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/libnsbmp.c b/src/libnsbmp.c
index 760ac91..f6ebd6c 100644
--- a/src/libnsbmp.c
+++ b/src/libnsbmp.c
@@ -325,11 +325,11 @@ static bmp_result bmp_info_header_parse(bmp_image *bmp, 
uint8_t *data)
                 if (!bmp->colour_table)
                         return BMP_INSUFFICIENT_MEMORY;
                 for (i = 0; i < bmp->colours; i++) {
-                        bmp->colour_table[i] = data[2] | (data[1] << 8) | 
(data[0] << 16);
+                        uint32_t colour = data[2] | (data[1] << 8) | (data[0] 
<< 16);
                         if (bmp->opaque)
-                                bmp->colour_table[i] |= ((uint32_t)0xff << 24);
+                                colour |= ((uint32_t)0xff << 24);
                         data += palette_size;
-                        bmp->colour_table[i] = read_uint32((uint8_t 
*)&bmp->colour_table[i],0);
+                        bmp->colour_table[i] = read_uint32((uint8_t 
*)&colour,0);
                 }
 
                 /* some bitmaps have a bad offset if there is a pallete, work
@@ -771,7 +771,7 @@ static bmp_result bmp_decode_rgb(bmp_image *bmp, uint8_t 
**start, int bytes)
         uint8_t cur_byte = 0, bit, i;
 
         /* Belt and braces, we shouldn't get here unless this holds */
-        assert(bmp->bpp > 0 && bmp->bpp <= 8);
+        assert(ppb >= 1);
 
         for (i = 0; i < ppb; i++)
                 bit_shifts[i] = 8 - ((i + 1) * bmp->bpp);


-- 
NetSurf BMP Decoder

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to