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

Loren Merritt lorenm
Wed Aug 27 22:38:15 CEST 2008


On Wed, 27 Aug 2008, Stefano Sabatini wrote:
>
> Well... I could use the X264_BUILD to do something as
>
> #if X264_BUILD < 61
>    if (avctx->rc_eq)
>        x4->params.rc.psz_rc_eq = avctx->rc_eq;
> #else
>        av_log(avctx, AV_LOG_WARNING, "Ignoring the rc_eq set, using the libx264 default one\n");
> #endif
>
> the problem with this is that it won't work anyway if the *linked*
> library isn't the same of the version of the header. Ideally if were
> available a function such as x264_build() then the abovementioned
> if/else could be performed run-time, lacking that I believe the best
> approach is the simplest and the more robust, so I'm for eliminating
> the rc_eq use, but to warn the user about that.

If the library version isn't the same as the header version, it breaks 
anyway, since I make no attempt to keep struct offsets constant. 
X264_BUILD is the .so version number too.
If I were to make a x264_build(), it would instead be used as 
assert(x264_build()==X264_BUILD) to catch inconsistent installs slightly 
more cleanly than segfault.

--Loren Merritt




More information about the ffmpeg-devel mailing list