[libav-devel] [PATCH] Revert "decode: copy the output parameters from the last bsf in the chain back to the AVCodecContext"

Luca Barbato lu_zero at gentoo.org
Thu Sep 13 14:35:31 CEST 2018


On 12/09/2018 20:24, James Almer wrote:
> This reverts commit 662558f985f50834eebe82d6b6854c66f33ab320.
> 
> The avcodec_parameters_to_context() call was freeing and reallocating
> AVCodecContext->extradata, essentially taking ownership of it, which according
> to the doxy is user owned. This is an API break and has produces crashes in
> some library users like Firefox.
> Revert until a better solution is found to internally propagate the filtered
> extradata back into the decoder context.

The doxy says:

     * - decoding: Set/allocated/freed by user.

We could be more explicit on what you can do with it though.

> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
> See https://bugzilla.mozilla.org/show_bug.cgi?id=1486080
> 
> Suggestions to work around it are very welcome, of course. While no bitstream
> filter currently autoinserted by a decoder requires the filtered extradata to
> be propagated to work properly, we don't know what may be needed in the future,
> and without this the usability of bsfs in decoders is potentially limited.

We already have AV_PKT_DATA_NEW_EXTRADATA to deal with extradata changes
at the demuxer level, we might reuse it.

I'm fine with the revert.

lu



More information about the libav-devel mailing list