aboutsummaryrefslogtreecommitdiff
path: root/src/libdraw/md-alloc.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-05-14 15:14:21 +0000
committerrsc <devnull@localhost>2004-05-14 15:14:21 +0000
commit1a8f27c35024af7b4ed857a388d20f0a4a560db0 (patch)
treeb70f33150772d665fd2c254655b2782289b0c9da /src/libdraw/md-alloc.c
parenta796abef1632f379ced703b1b2e691d8f63436e2 (diff)
downloadplan9port-1a8f27c35024af7b4ed857a388d20f0a4a560db0.tar.gz
plan9port-1a8f27c35024af7b4ed857a388d20f0a4a560db0.tar.bz2
plan9port-1a8f27c35024af7b4ed857a388d20f0a4a560db0.zip
various bug fixes
Diffstat (limited to 'src/libdraw/md-alloc.c')
-rw-r--r--src/libdraw/md-alloc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libdraw/md-alloc.c b/src/libdraw/md-alloc.c
index 801c3930..b4204f4e 100644
--- a/src/libdraw/md-alloc.c
+++ b/src/libdraw/md-alloc.c
@@ -86,7 +86,13 @@ _allocmemimage(Rectangle r, u32int chan)
return nil;
md->ref = 1;
- md->base = poolalloc(imagmem, (2+nw)*sizeof(u32int));
+ /*
+ * The first two words are the md and the callerpc.
+ * Then nw words of data.
+ * The final word lets the drawing routines be a little
+ * sloppy about reading past the end of the block.
+ */
+ md->base = poolalloc(imagmem, (2+nw+1)*sizeof(u32int));
if(md->base == nil){
free(md);
return nil;