Opened 8 months ago
Last modified 8 months ago
#9957 new defect
v4l2_m2m decoding: trying to dequeue capture queue while queue is not allocated
|Reported by:||trya||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
Description (last modified by )
Summary of the bug:
At the first call of v4l2_receive_frame(), if the packet fails to be decoded with error EAGAIN, the function tries to dequeue from the capture context, while the capture buffers have not been allocated yet (they will be on a further call to v4l2_try_start()), thus causing a segfault in that case.
How to reproduce:
Play or decode any H264 video on a Raspberry Pi with the h264_v4l2m2m decoder. I encountered the problem with mpv first (any version), and couldn't get to reproduce it with neither ffmpeg or ffplay, because the first call to ff_decode_get_packet() doesn't fail with EAGAIN, thus allowing the capture buffers to be allocated after then.
Calling v4l2_try_start() between ff_decode_get_packet() and ff_v4l2_context_dequeue_frame() seems to prevent segfault on mpv. But then, mpv cannot either seek or loop the video, and ffplay cannot seek either, but that seems unrelated to this issue.
Change History (2)
comment:1 by , 8 months ago
comment:2 by , 8 months ago
Related issue on mpv: https://github.com/mpv-player/mpv/issues/10701