[FFmpeg-devel] [PATCH] lavu/opt: handle NULL during class comparsion

Lukasz Marek lukasz.m.luki2 at gmail.com
Wed Dec 3 14:54:29 CET 2014

On 3 December 2014 at 14:29, Lukasz Marek <lukasz.m.luki2 at gmail.com> wrote:

> On 3 December 2014 at 14:10, Michael Niedermayer <michaelni at gmx.at> wrote:
>> On Wed, Dec 03, 2014 at 12:06:18AM +0100, Lukasz Marek wrote:
>> > av_opt_copy compares classes to avoid copying between mismatched
>> objects.
>> > This protection fails when dest class is NULL.
>> does this case actually occur ?
> Yes and no.
> There was a crush in ffmpeg, when avcodec_copy_context was called on
> context of codec that has no class in priv context.
> It is fixed by:
> [PATCH] lavc/options: don't copy priv context when it is not AVOption
> object.
> Calling this function on non-avclass object is misuse of this function of
> course. So probably patch is not needed, but maybe doesn't hurt.

To summarize, I drop this patch for now.
I will create some tests for avcodec_copy_context for corner cases and some
fixes if needed.
If extra checks are needed then probably not here.

More information about the ffmpeg-devel mailing list