Against All Flags (1952)
Against All Flags is a 1952 American pirate film starring Errol Flynn as Brian Hawke, Maureen O'Hara as Prudence "Spitfire" Stevens and Anthony Quinn as Roc Brasiliano. In 1700, British officer Brian Hawke infiltrates a group of pirates located on Libertatia on the coast of Madagascar, and falls in love with pirate captain "Spitfire" Stevens.
More at Wikipedia.