[FFmpeg-devel] [PATCH] avcodec/bsf: check that AVBSFInternal was allocated before dereferencing it

Paul B Mahol onemda at gmail.com
Mon Sep 23 11:16:57 EEST 2019


lgtm

On 9/23/19, James Almer <jamrial at gmail.com> wrote:
> This can happen when av_bsf_free() is called on av_bsf_alloc() failure.
>
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavcodec/bsf.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c
> index 71915dea85..c1653cddb0 100644
> --- a/libavcodec/bsf.c
> +++ b/libavcodec/bsf.c
> @@ -47,7 +47,8 @@ void av_bsf_free(AVBSFContext **pctx)
>
>      av_opt_free(ctx);
>
> -    av_packet_free(&ctx->internal->buffer_pkt);
> +    if (ctx->internal)
> +        av_packet_free(&ctx->internal->buffer_pkt);
>      av_freep(&ctx->internal);
>      av_freep(&ctx->priv_data);
>
> --
> 2.22.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list