avcodec/pcm_rechunk_bsf: unref packet before putting a new one in

Fixes: memleak
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_BSF_PCM_RECHUNK_fuzzer-5562089618407424

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/389/head
Michael Niedermayer 3 years ago
parent e2c3aa8e2b
commit 1440bf15e2
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 3
      libavcodec/pcm_rechunk_bsf.c

@ -151,7 +151,8 @@ static int rechunk_filter(AVBSFContext *ctx, AVPacket *pkt)
av_packet_move_ref(pkt, s->in_pkt);
return send_packet(s, nb_samples, pkt);
}
}
} else
av_packet_unref(s->in_pkt);
ret = ff_bsf_get_packet_ref(ctx, s->in_pkt);
if (ret == AVERROR_EOF && s->out_pkt->size) {

Loading…
Cancel
Save