Commit 76e0ecec authored by Andreas Rheinhardt's avatar Andreas Rheinhardt Committed by James Almer

avcodec/extract_extradata_bsf: Don't unref uninitialized buffers

This happens if allocating extradata fails and s->remove is unset.
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 18507b48
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment