CtVideo::Image buffer python binding with empty buffer segfault
When reading the video_last_image
from a Device Server that has just been started, LimaCCDs segfault.
It looks like PyString_FromStringAndSize(NULL, 0)
returns an invalid value which usage might segfault with Python 3.10.
The issue is seen in the Device Server that does not check if video.getLastImage()
returns a proper value before parsing it:
def read_video_last_image(self, attr):
video = self.__control.video()
self._videoStr = _video_image_2_struct(video.getLastImage())
attr.set_value("VIDEO_IMAGE", self._videoStr)
Funnily I cannot reproduce this with the simulator, but it is systematic with the PCO.