av_bsf_send_packet can't take ownership on not reference-counted packets
|Reported by:||mrlika||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
Because it doesn't know how to release it. And caller also doesn't know when to delete the packet passed to black-box algorithm.
For not reference-counted packets it is more correct to create referenced-counted copy of the packet and leave ownership to the caller.
For example av_grow_packet h264_mp4toannexb and h265_mp4toannexb already call av_grow_packet on input packets that just overwrites pkt->data field with newly allocated buffer for not reference-counted packets. It leads to memory leak.