commit 33cdf63251a23d71906cb482bce4ca02ce6d94c0 from: Erik Quanstrom via: Russ Cox date: Sun Oct 21 16:08:49 2012 UTC libmemdraw: fix int size bug R=rsc, quanstro CC=plan9port.codebot http://codereview.appspot.com/6657043 commit - c5bfba483f4002c539cbeb4087827524dba8d0f8 commit + 33cdf63251a23d71906cb482bce4ca02ce6d94c0 blob - b6ad61a73511c09d9c969629c292374b752e28bf blob + fa23b5e03cd8a5db59d03610494d0c20423e2d35 --- src/libmemdraw/alloc.c +++ 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){ /*