Fix a memory leak encoding on FFmpeg v2.3.