[FFmpeg-devel] [PATCH] Check codec_whitelist before reinitializing AVCtx.priv_data.

Anton Khirnov anton at khirnov.net
Sat Aug 17 11:42:00 EEST 2024


Quoting Dale Curtis (2024-07-31 23:10:24)
> On Wed, Jul 31, 2024 at 4:32 AM Anton Khirnov <anton at khirnov.net> wrote:
> 
> > Quoting Dale Curtis (2024-07-31 01:14:13)
> > > I realized there are a couple more allocations that can be skipped here
> > > when a codec is not on the allow list. Here's the updated patch.
> > >
> > > - dale
> > >
> > > On Mon, Jul 29, 2024 at 10:19 AM Dale Curtis <dalecurtis at chromium.org>
> > > wrote:
> > >
> > > > This ensures that if a codec isn't on codec_whitelist, its VUI
> > > > information can still be populated during find_stream_info()
> > > > via parsers.
> > > >
> > > > Signed-off-by: Dale Curtis <dalecurtis at chromium.org>
> > > > ---
> > > >  libavcodec/avcodec.c | 12 ++++++------
> > > >  1 file changed, 6 insertions(+), 6 deletions(-)
> > > >
> > > >
> > >
> > > From f87042d77d13c4c45f4b800146dc16347c1007d4 Mon Sep 17 00:00:00 2001
> > > From: Dale Curtis <dalecurtis at chromium.org>
> > > Date: Tue, 30 Jul 2024 23:12:21 +0000
> > > Subject: [PATCH] Check codec_whitelist before reinitializing
> > AVCtx.priv_data.
> > >
> > > This ensures that if a codec isn't on codec_whitelist, its VUI
> > > information can still be populated during find_stream_info()
> > > via parsers.
> >
> > Can you elaborate on this?
> >
> 
> The current code reinitializes the private data structures then checks the
> whitelist. If the private data section had already been filled out, it ends
> up being overwritten causing find_stream_info to drop side channel data.

I don't follow, why would any code outside of libavcodec care about
anything in private data?

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list