diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c index 62fe7ae5e8..8ba021cb47 100644 --- a/libavcodec/bsf.c +++ b/libavcodec/bsf.c @@ -201,6 +201,8 @@ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt) int ret; if (!pkt || IS_EMPTY(pkt)) { + if (pkt) + av_packet_unref(pkt); bsfi->eof = 1; return 0; }