Fixed ffmpeg close/buf-free bug