Skip to content

viddec: don't configure an incorrect buffer pool when receiving a gap event

Scenario is this:

  1. libav receives enough data to want a buffer with get_buffer2() which wants a buffer pool with a certain format, say Y42B but does not negotiate and therefore GstVideoDecoder does not have any output state configured
  2. A gap event is received which GstVideoDecoder wants to forward. It needs caps to forward the gap event so attempts to negotiate with some default information which chooses e.g. I420 and overwrites the previously configured bufferpool decided on by get_buffer2()
  3. There is a mismatch between what ensure_internal_pool() check for consistency and what decide_allocation() sets when overriding the internal pool with the downstream pool.
  4. FFMpeg then requests a Y42B buffer from an I420 pool and predictably crashes writing past the contents of the buffer

This is fixed by keeping track of the internal pool states correctly.

Edited by Matthew Waters

Merge request reports

Loading