Fixed a bug with the video decode function.