[FFmpeg-cvslog] avcodec/bsf: check that AVBSFInternal was allocated before dereferencing it
James Almer
git at videolan.org
Mon Sep 23 16:13:04 EEST 2019
ffmpeg | branch: release/4.1 | James Almer <jamrial at gmail.com> | Sun Sep 22 23:55:49 2019 -0300| [11cce24e04e186e29360fd0142db4f2af461c5b6] | committer: James Almer
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 at gmail.com>
Signed-off-by: James Almer <jamrial at gmail.com>
(cherry picked from commit d889ae33962e4ad2b24175418fe89d72ce712179)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=11cce24e04e186e29360fd0142db4f2af461c5b6
---
libavcodec/bsf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c
index 03841da682..58c184e22a 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);
More information about the ffmpeg-cvslog
mailing list