rotate: fix crash when image origin is not (0,0)

front
glenda 2011-12-02 12:09:08 +01:00
parent d63b461ecf
commit 2608224b47
1 changed files with 2 additions and 1 deletions

View File

@ -41,7 +41,8 @@ rot90(Memimage *m)
dx = Dx(m->r); dx = Dx(m->r);
dy = Dy(m->r); dy = Dy(m->r);
if((w = allocmemimage(Rect(m->r.min.x, m->r.min.y, dy, dx), m->chan)) == nil) if((w = allocmemimage(Rect(m->r.min.x, m->r.min.y,
m->r.min.x+dy, m->r.min.y+dx), m->chan)) == nil)
sysfatal("allocmemimage: %r"); sysfatal("allocmemimage: %r");
line = w->width*sizeof(ulong); line = w->width*sizeof(ulong);
for(y=0; y<dy; y++){ for(y=0; y<dy; y++){