avpacket: Check buffer reference