[vlc-devel] [PATCH] decoder: fix out_pool NULL deref

Rémi Denis-Courmont remi at remlab.net
Tue Mar 10 17:10:00 CET 2020

Le tiistaina 10. maaliskuuta 2020, 10.20.58 EET Steve Lhomme a écrit :
> On 2020-03-10 8:56, Thomas Guillem wrote:
> > Once the format is configured, a decoder module can request new picture_t
> > via decoder_NewPicture() asynchronously. Therefore, the out_pool need to
> > outlive the decoder module.
> If your decoder is asking for a new picture_t when it's actually being
> destroyed, you probably a synchronization problem.

I disagree.

There is necessarily a time window when an asynchronous decoder may be 
requesting a picture from a different thread, or invoking any other decoder 
callback, while the decoder is being stopped.

The only guaranty that the decoder makes is that it will not invoke callbacks 
*after* the close callback returns. This is generally true of every 
asynchronous or potentially asynchronous module type that we have.

In fact, I think that the decoder should be allowed to allocate pictures even 
if it was flushed and has not seen any input data since. It's a valid 
implementation to allocate picture buffers before data arrives to be decoded 
into those buffers.


More information about the vlc-devel mailing list