avcodec_copy_context() didn't handle hw_frames_ctx references correctly which could cause crashes. Signed-off-by: Anton Khirnov <anton@khirnov.net>