[FFmpeg-devel] [PATCH] lavfi/buffersrc: do not dereference NULL frame.

Stefano Sabatini stefasab at gmail.com
Sun Mar 10 18:13:01 CET 2013


Nit++: no ending point in subject

On date Sunday 2013-03-10 16:29:42 +0100, Nicolas George encoded:
> frame = NULL is used to indicate EOF.
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavfilter/buffersrc.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
> index 185018d..be860aa 100644
> --- a/libavfilter/buffersrc.c
> +++ b/libavfilter/buffersrc.c
> @@ -93,9 +93,9 @@ int av_buffersrc_add_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flags
>  {
>      AVFrame *copy = NULL;
>      int ret = 0;
> -    int64_t layout = frame->channel_layout;
>  
> -    if (layout && av_get_channel_layout_nb_channels(layout) != av_frame_get_channels(frame)) {
> +    if (frame && frame->channel_layout &&
> +        av_get_channel_layout_nb_channels(frame->channel_layout) != av_frame_get_channels(frame)) {
>          av_log(0, AV_LOG_ERROR, "Layout indicates a different number of channels than actually present\n");
>          return AVERROR(EINVAL);

LGTM, thanks.
-- 
FFmpeg = Fast Forgiving Moronic Perfectionist Exploitable Guru


More information about the ffmpeg-devel mailing list