fix memory leakage of av_packet