Terrifyingly close call for BEN STILLER, directing “The Secret Life of Walter Mitty” in New York.

While setting up a shot, he stepped backward off a curb – and suddenly the air shook with the sound of scr-e-e-eching brakes as a truck loaded with diapers swerved to avoid squashing him.

“You could see the panic on Ben’s face,” said a set source.

The furious driver  shouted: “What the %$*# are you doing man! You’re lucky you’re still alive!”

Despite the near-death experience, Ben’s comedy edge stayed cutting-sharp as he quipped to his staff: “I can see the headlines now, ‘Comedian Killed by Truck full of S—!’ ”