The film you are looking for is Snakes on a Plane (2006), starring Samuel L. Jackson.
Snakes on a Plane is a 2006 American action-thriller film directed by David R. Ellis and starring Samuel L. Jackson. The film follows an FBI agent who must protect a witness on a plane from a group of snakes that have been released on board. The film was a commercial success, grossing over $62 million worldwide. It was nominated for a Saturn Award, and has become a cult classic.