<html><head></head><body>If the image will always be 2D, you can add<br>
<br>
cdef Py_ssize_t shape[2]<br>
<br>
To your cdef class and assign self.shape to the Py_buffer. This is a bit more efficient.<br>
<br>
Dag<br>
-- <br>
Sent from my Android phone with K-9 Mail. Please excuse my brevity.<br><br><div class="gmail_quote">Christian Heimes &lt;lists@cheimes.de&gt; wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre style="white-space: pre-wrap; word-wrap:break-word; font-family: sans-serif">Am 17.07.2012 22:55, schrieb Christian Heimes:<br />&gt; Either I'm doing something wrong or I found a Cython bug. I've attached<br />&gt; two files. The output is unexpected and looks like something is<br />&gt; accessing uninitialized memory:<br /><br />For the record:<br />It's my fault. The shade and stripes Py_ssize_t* arrays can't be local<br />variables. I've to malloc() two arrays and free() them in<br />__releasebuffer__(). Cython is so easy to use, it makes me forget all<br />this little annoying C things.<br /><br />Christian<br /><br /><hr /><br />cython-devel mailing list<br />cython-devel@python.org<br /><a href="http://mail.python.org/mailman/listinfo/cython-devel">http://mail.python.org/mailman/listinfo/cython-devel</a><br /></pre></blockquote></div></body></html>