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

Robert Swain robert.swain
Mon Aug 25 20:16:15 CEST 2008


2008/8/25 M?ns Rullg?rd <mans at mansr.com>:
> Stefano Sabatini <stefano.sabatini-lala at poste.it> writes:
>
>> On date Monday 2008-08-25 17:41:05 +0200, Guillaume POIRIER encoded:
>>> Hello,
>>>
>>> On Mon, Aug 25, 2008 at 5:19 PM, Stefano Sabatini
>>> <stefano.sabatini-lala at poste.it> wrote:
>>>
>>> [..]
>>> >> Index: libavcodec/libx264.c
>>> >> ===================================================================
>>> >> --- libavcodec/libx264.c      (revision 14863)
>>> >> +++ libavcodec/libx264.c      (working copy)
>>> >> @@ -253,7 +253,7 @@
>>> >>      x4->params.rc.f_ip_factor = 1/fabs(avctx->i_quant_factor);
>>> >>      x4->params.rc.f_pb_factor = avctx->b_quant_factor;
>>> >>      x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset;
>>> >> -    x4->params.rc.psz_rc_eq = avctx->rc_eq;
>>> >> +    x4->params.rc.psz_rc_eq = avctx->rc_eq ? avctx->rc_eq : "tex^qComp";
>>> >>
>>> >>      x4->params.analyse.b_psnr = avctx->flags & CODEC_FLAG_PSNR;
>>> >>      x4->params.i_log_level = X264_LOG_DEBUG;
>>> >
>>> > Ping?
>>> >
>>> > A lot of people are complainig about this on ffmpeg-user, could
>>> > someone review it?
>>>
>>> no need to. x264 won't need rc_eq to be set in a few days...
>>
>> But older libx264 versions will lye around for a long time, so IMO is
>> still a good idea to fix the problem.
>
> But we need to support the latest x264, which won't even have that
> field in the struct.  What does old/current x264 do if it isn't
> touched at all?

We set the defaults before assigning values from avctx so if it's
untouched it should be the x264 default. Completely removing this
assignment when rc_eq is hard-coded in x264 will be sufficient.

Rob



More information about the ffmpeg-devel mailing list