Opened 2 years ago
Closed 15 months ago
#9957 closed defect (fixed)
v4l2_m2m decoding: trying to dequeue capture queue while queue is not allocated
Reported by: | trya | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avcodec |
Version: | git-master | Keywords: | v4l2m2m |
Cc: | trya | Blocked 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 (3)
comment:1 by , 2 years ago
comment:2 by , 2 years ago
Description: | modified (diff) |
---|
comment:3 by , 15 months ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in 4fa1d3e7910c3fbe3aacbe5ae5233d0067569c02.
Related issue on mpv: https://github.com/mpv-player/mpv/issues/10701