aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-11-30 07:38:10 +0100
committerJames Almer <jamrial@gmail.com>2019-12-06 21:33:54 -0300
commit2722fc2bcfae03feea131737f7da451358a05a7b (patch)
treedfaa9840e47162fb33e7b481f72446a9f1c06bb7
parent40123639fe7edc2cbd42f2b1ffb9d072131be5ad (diff)
downloadffmpeg-2722fc2bcfae03feea131737f7da451358a05a7b.tar.gz
avcodec/extract_extradata_bsf: Don't unref uninitialized buffers
This happens if allocating extradata fails and s->remove is unset. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit 76e0ecec0bfade85796ccfeb9ffdfd55c666612e)
-rw-r--r--libavcodec/extract_extradata_bsf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/extract_extradata_bsf.c b/libavcodec/extract_extradata_bsf.c
index 17e5deb96b..85cf615ffa 100644
--- a/libavcodec/extract_extradata_bsf.c
+++ b/libavcodec/extract_extradata_bsf.c
@@ -85,7 +85,7 @@ static int extract_extradata_av1(AVBSFContext *ctx, AVPacket *pkt,
}
if (extradata_size && has_seq) {
- AVBufferRef *filtered_buf;
+ AVBufferRef *filtered_buf = NULL;
uint8_t *extradata, *filtered_data;
if (s->remove) {
@@ -179,7 +179,7 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,
if (extradata_size &&
((ctx->par_in->codec_id == AV_CODEC_ID_HEVC && has_sps && has_vps) ||
(ctx->par_in->codec_id == AV_CODEC_ID_H264 && has_sps))) {
- AVBufferRef *filtered_buf;
+ AVBufferRef *filtered_buf = NULL;
uint8_t *extradata, *filtered_data;
if (s->remove) {