mem leaks bug fix, for ffmpeg AVIOContext  AVFMT_FLAG_CUSTOM_IO flag