Skip to content

v4l2videodec: ensure pool exists before orphaning it

In commit e2ff8773 ("v4l2videodec: support orphaning") support for orphaning the capture buffer pool was added when the format is renegotiated. However, the commit forgot to check that a pool existed before doing this. This is needed because it's possible for the format to be renegotiated before a capture pool is allocated, which would result in trying to orphan a NULL pool and lead to a NULL pointer dereference.

Fix this by checking a pool exists first. If the pool doesn't exist, there are no buffers to be reclaimed, so skip the allocation query in that case.


This fixes a segfault I've seen on one of Thinci's boards running this contrived pipeline:

gst-launch-1.0 -v videotestsrc ! v4l2h264enc ! h264parse ! v4l2h264dec ! fakesink

Merge request reports