diff options
author | Erik Quanstrom <quanstro@quanstro.net> | 2012-10-21 12:08:49 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2012-10-21 12:08:49 -0400 |
commit | 33cdf63251a23d71906cb482bce4ca02ce6d94c0 (patch) | |
tree | 6a169670a84500665ef5ad80ba5c5f287286dba8 | |
parent | c5bfba483f4002c539cbeb4087827524dba8d0f8 (diff) | |
download | plan9port-33cdf63251a23d71906cb482bce4ca02ce6d94c0.tar.gz plan9port-33cdf63251a23d71906cb482bce4ca02ce6d94c0.tar.bz2 plan9port-33cdf63251a23d71906cb482bce4ca02ce6d94c0.zip |
libmemdraw: fix int size bug
R=rsc, quanstro
CC=plan9port.codebot
http://codereview.appspot.com/6657043
-rw-r--r-- | src/libmemdraw/alloc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libmemdraw/alloc.c b/src/libmemdraw/alloc.c index b6ad61a7..fa23b5e0 100644 --- a/src/libmemdraw/alloc.c +++ b/src/libmemdraw/alloc.c @@ -141,7 +141,8 @@ byteaddr(Memimage *i, Point p) { uchar *a; - a = i->data->bdata+i->zero+sizeof(u32int)*p.y*i->width; + /* careful to sign-extend negative p.y for 64-bits */ + a = i->data->bdata+i->zero+(int)(sizeof(u32int)*p.y*i->width); if(i->depth < 8){ /* |