How do I repair movies with "invalid public movie atoms"?
I recommend using the free app HandBrake to re-encode the movie, which will hopefully fix the problem.

Open HandBrake and it will automatically ask you to select a source (otherwise, you can use the Source toolbar item). Select the problematic movie and click Open.

Make sure the Presets panel is visible by clicking the Toggle Presets toolbar item. Then, under Apple, select the Universal preset.

The default settings should be fine, but you can tweak them if you like.

Click the Start toolbar item to begin. HandBrake will chug away and re-encode the file. That's likely to fix any problems with the encoding.