Date: Thu, 13 Dec 2012 21:26:07 GMT From: Brooks Davis <brooks@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 219903 for review Message-ID: <201212132126.qBDLQ7tk063233@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@219903?ac=10 Change 219903 by brooks@brooks_zenith on 2012/12/13 21:25:16 Use a per-instance offset rather than a bogus global one. Affected files ... .. //depot/projects/ctsrd/cheribsd/src/ctsrd/libexec/readpng-cheri/readpng-cheri.c#6 edit Differences ... ==== //depot/projects/ctsrd/cheribsd/src/ctsrd/libexec/readpng-cheri/readpng-cheri.c#6 (text+ko) ==== @@ -46,13 +46,14 @@ int pngwidth; -int offset = 0; static void cheri_read_data(png_structp png_ptr __unused, png_bytep data, png_size_t length) { - - memcpy_fromcap(data, 2, offset, length); - offset += length; + struct ibox_decode_state *ids; + + ids = png_get_io_ptr(png_ptr); + memcpy_fromcap(data, 2, ids->offset, length); + ids->offset += length; } static void @@ -92,6 +93,7 @@ is.sb = SB_CHERI; ids.fd = -1; + ids.offset = 0; /* * in principle we could update this via a capabilty, * but in practice we can reconstruct it on exit
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212132126.qBDLQ7tk063233>