Gitweb links:

...log 
http://git.netsurf-browser.org/libnsfb.git/shortlog/7bb4955f3fc64627c4c3f93b28173e7fc853e775
...commit 
http://git.netsurf-browser.org/libnsfb.git/commit/7bb4955f3fc64627c4c3f93b28173e7fc853e775
...tree 
http://git.netsurf-browser.org/libnsfb.git/tree/7bb4955f3fc64627c4c3f93b28173e7fc853e775

The branch, master has been updated
       via  7bb4955f3fc64627c4c3f93b28173e7fc853e775 (commit)
       via  90c270599b5b6c10ac06c37a0efb142d2d06bb3a (commit)
      from  c22673e339c729016299000b844dead5b2bf0f25 (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/libnsfb.git/commit/?id=7bb4955f3fc64627c4c3f93b28173e7fc853e775
commit 7bb4955f3fc64627c4c3f93b28173e7fc853e775
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    8 bit glyph plotter: Squash undefined shift error.
    
    src/plot/common.c:216:83: runtime error: left shift of 170 by 24 places 
cannot be represented in type 'int'

diff --git a/src/plot/common.c b/src/plot/common.c
index b051131..5f55686 100644
--- a/src/plot/common.c
+++ b/src/plot/common.c
@@ -213,7 +213,7 @@ glyph8(nsfb_t *nsfb,
 
         for (yloop = 0; yloop < height; yloop++) {
                 for (xloop = 0; xloop < width; xloop++) {
-                        abpixel = (pixel[((yoff + yloop) * pitch) + xloop + 
xoff] << 24) | fgcol;
+                        abpixel = ((unsigned)pixel[((yoff + yloop) * pitch) + 
xloop + xoff] << 24) | fgcol;
                         if ((abpixel & 0xFF000000) != 0) {
                                 /* pixel is not transparent */
                                 if ((abpixel & 0xFF000000) != 0xFF000000) {


commitdiff 
http://git.netsurf-browser.org/libnsfb.git/commit/?id=90c270599b5b6c10ac06c37a0efb142d2d06bb3a
commit 90c270599b5b6c10ac06c37a0efb142d2d06bb3a
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Ploygon filling: Fix undefined behaviour.
    
    src/plot/generic.c:243:10: runtime error: signed integer overflow: 
2147483647 + 1 cannot be represented in type 'int'

diff --git a/src/plot/generic.c b/src/plot/generic.c
index 5479b2e..ea0bb04 100644
--- a/src/plot/generic.c
+++ b/src/plot/generic.c
@@ -128,6 +128,10 @@ static bool establish_crossing_value(int x, int y, int x0, 
int y0,
  */
 static bool find_span(const int *p, int n, int x, int y, int *x0, int *x1)
 {
+       enum {
+               NO_MIN = INT_MIN + 1,
+               NO_MAX = INT_MAX - 1,
+       };
        int i;
        int p_x0, p_y0;
        int p_x1, p_y1;
@@ -137,16 +141,16 @@ static bool find_span(const int *p, int n, int x, int y, 
int *x0, int *x1)
        bool crossing_value;
        bool found_span_start = false;
 
-       x0_min = x1_min = INT_MIN;
+       x0_min = x1_min = NO_MIN;
        x0c = x1c = 0;
 
        /* search row for next span, returning it if one exists */
        do {
                /* reset endpoint info, if valid span endpoints not found */
                if (!found_span_start) {
-                       *x0 = INT_MAX;
+                       *x0 = NO_MAX;
                }
-               *x1 = INT_MAX;
+               *x1 = NO_MAX;
 
                /* search all lines in polygon */
                for (i = 0; i < n; i = i + 2) {
@@ -242,7 +246,7 @@ static bool find_span(const int *p, int n, int x, int y, 
int *x0, int *x1)
                        x0_min = *x0 + 1;
                x1_min = *x1 + 1;
 
-       } while (*x1 != INT_MAX);
+       } while (*x1 != NO_MAX);
 
        /* no spans found */
        return false;


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

Summary of changes:
 src/plot/common.c  |    2 +-
 src/plot/generic.c |   12 ++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/plot/common.c b/src/plot/common.c
index b051131..5f55686 100644
--- a/src/plot/common.c
+++ b/src/plot/common.c
@@ -213,7 +213,7 @@ glyph8(nsfb_t *nsfb,
 
         for (yloop = 0; yloop < height; yloop++) {
                 for (xloop = 0; xloop < width; xloop++) {
-                        abpixel = (pixel[((yoff + yloop) * pitch) + xloop + 
xoff] << 24) | fgcol;
+                        abpixel = ((unsigned)pixel[((yoff + yloop) * pitch) + 
xloop + xoff] << 24) | fgcol;
                         if ((abpixel & 0xFF000000) != 0) {
                                 /* pixel is not transparent */
                                 if ((abpixel & 0xFF000000) != 0xFF000000) {
diff --git a/src/plot/generic.c b/src/plot/generic.c
index 5479b2e..ea0bb04 100644
--- a/src/plot/generic.c
+++ b/src/plot/generic.c
@@ -128,6 +128,10 @@ static bool establish_crossing_value(int x, int y, int x0, 
int y0,
  */
 static bool find_span(const int *p, int n, int x, int y, int *x0, int *x1)
 {
+       enum {
+               NO_MIN = INT_MIN + 1,
+               NO_MAX = INT_MAX - 1,
+       };
        int i;
        int p_x0, p_y0;
        int p_x1, p_y1;
@@ -137,16 +141,16 @@ static bool find_span(const int *p, int n, int x, int y, 
int *x0, int *x1)
        bool crossing_value;
        bool found_span_start = false;
 
-       x0_min = x1_min = INT_MIN;
+       x0_min = x1_min = NO_MIN;
        x0c = x1c = 0;
 
        /* search row for next span, returning it if one exists */
        do {
                /* reset endpoint info, if valid span endpoints not found */
                if (!found_span_start) {
-                       *x0 = INT_MAX;
+                       *x0 = NO_MAX;
                }
-               *x1 = INT_MAX;
+               *x1 = NO_MAX;
 
                /* search all lines in polygon */
                for (i = 0; i < n; i = i + 2) {
@@ -242,7 +246,7 @@ static bool find_span(const int *p, int n, int x, int y, 
int *x0, int *x1)
                        x0_min = *x0 + 1;
                x1_min = *x1 + 1;
 
-       } while (*x1 != INT_MAX);
+       } while (*x1 != NO_MAX);
 
        /* no spans found */
        return false;


-- 
NetSurf Framebuffer library

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

Reply via email to