diff options
author | James Almer <jamrial@gmail.com> | 2019-09-22 23:55:49 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-09-23 10:02:03 -0300 |
commit | d889ae33962e4ad2b24175418fe89d72ce712179 (patch) | |
tree | 6ff8e116500d93ef119fd6ff185018827fa63dc8 /libavcodec/bsf.c | |
parent | eaf3c4b8bf292aefdf6eb8e4ca15ea24df48ca04 (diff) | |
download | ffmpeg-d889ae33962e4ad2b24175418fe89d72ce712179.tar.gz |
avcodec/bsf: check that AVBSFInternal was allocated before dereferencing it
This can happen when av_bsf_free() is called on av_bsf_alloc() failure.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/bsf.c')
-rw-r--r-- | libavcodec/bsf.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); |