aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2019-09-22 23:55:49 -0300
committerJames Almer <jamrial@gmail.com>2019-09-23 10:09:16 -0300
commit45bf2f4d72f11ea4bf757b413931fc1b43c0d643 (patch)
treef4ab4b8bcd0c5756b6bdcaf3601eb118ed88e360
parentcfa7c079f72b65bfe038af84d95d384a609d4f0a (diff)
downloadffmpeg-45bf2f4d72f11ea4bf757b413931fc1b43c0d643.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> (cherry picked from commit d889ae33962e4ad2b24175418fe89d72ce712179)
-rw-r--r--libavcodec/bsf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c
index 38b423101c..676c271b9c 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);