Fix the memory leak in the video decoder