avoid the pitfalls of the usual conversions when widening ulong to 64 bits. Reference: /n/patches.lsub.org/patch/memdrawneg Date: Wed Oct 10 16:44:39 CES 2012 Signed-off-by: quanstro@quanstro.net --- /sys/src/libmemdraw/addr.c Sun Sep 9 02:53:33 2012 +++ /sys/src/libmemdraw/addr.c Wed Oct 10 07:47:49 2012 @@ -17,7 +17,8 @@ { uchar *a; - a = i->data->bdata+i->zero+sizeof(ulong)*p.y*i->width; + /* careful to sign-extend negative p.y for 64-bits */ + a = i->data->bdata+i->zero+(int)(sizeof(ulong)*p.y*i->width); if(i->depth < 8){ /*