diff options
Diffstat (limited to 'src')
-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){ /* |