PTAUchar issues

Hi,

When I use this piece of code:

        buffer  = PTAUchar()
        buffer.setData(image.tostring())
        texture.setFormat(texture.FLuminance)
        texture.setXSize(image.size[0])
        texture.setYSize(image.size[1])
        texture.setRamImage(CPTAUchar(buffer),MovieTexture.CMOff)

I got an error on the setData:

Assertion failed: (this->_void_ptr) != NULL at line 570 of built/include/pointerToArray.I

On the other hand, if I do put the code in a try/excet, ignoring the error message, everything seems to works.

Do I do something wrong?

PTAUchar() creates a NULL pointer, which is technically invalid to assign data to. To correctly create an empty array, use:

buffer = PTAUchar.emptyArray(0)

David