summaryrefslogtreecommitdiff
path: root/test/v4l2_videodevice/request_buffers.cpp
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2020-06-03 22:21:25 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2020-06-08 17:11:38 +0900
commit5c5481911a04c92de390cb63803aec6120ebdce6 (patch)
treef2d4285af03b057b86317b36e1eb0de1073d4d9e /test/v4l2_videodevice/request_buffers.cpp
parent4ed996990dba907c8916ccf2e3b08f9c4988b641 (diff)
v4l2: v4l2_camera_proxy: Don't return -EINVAL for zero sizeimage in REQBUFS
If VIDIOC_REQBUFS returns -EINVAL, it signals to the application that the requested buffer or memory type is not supported. If we return -EINVAL due to a zero sizeimage, then the application will think that we don't support a memory type that we actually do. We cannot error on a zero sizeimage, because reqbufs could be called merely to probe what IO methods we support; qv4l2, for example, called reqbufs once with userptr and once more with mmap, both times with count=1. On the other hand, sizeimage will be zero for formats whose size we don't know how to calculate, such as MJPEG. If we try to stream such formats anyway, we will get a floating point exception and crash. Issue a warning for now, and don't return -EINVAL, so that we can continue operation. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'test/v4l2_videodevice/request_buffers.cpp')
0 files changed, 0 insertions, 0 deletions