[FFmpeg-devel] [PATCH] Fix crash in libx264 when rc_eq is not set

Stefano Sabatini stefano.sabatini-lala
Tue Aug 26 23:59:38 CEST 2008

On date Tuesday 2008-08-26 21:40:43 +0200, Reimar D?ffinger encoded:
> On Tue, Aug 26, 2008 at 08:08:09PM +0200, Stefano Sabatini wrote:
> > I'm also for keeping that feature.
> > 
> > Ideally libx264 should be able to set its default value if libavcodec
> > leaves it to NULL, but this would break (at least) old libx264
> > versions.
> > 
> > So I propose again my first patch, which I attach.
> Going by the previous discussions the right solution is
> > if (avctx->rc_eq)
> >     x4->params.rc.psz_rc_eq = avctx->rc_eq;
> if you want to keep the functionality.

Yes, thank you.

So this will set rc_eq in the libx264 context only if avctx->rc_eq is
defined, otherwise will keep the libx264 default value (which is
already set *before* libavcodec has the chance to set it).

BTW what will happen when the eval functionality will be removed from
libx264? If the psz_rc_eq field will have been removed as well this
will break compilation (unless to update the ffmpeg code to comply
with latest libx264 versions).

I'll apply tomorrow on evening if no one will have objected.

FFmpeg = Foolish and Free Meaningless Patchable Eager Ghost
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-libx64-rc-eq-crash-02.patch
Type: text/x-diff
Size: 614 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080826/87723c9e/attachment.patch>

More information about the ffmpeg-devel mailing list