Not quite...
If the frame is set to 'Do Not Dispose' it WILL be included regardless of its layer visibility.
I agree.....but all the frames have 'Do Not Dispose' set on them.
Totally agree....but masking isn't why previous frames are being shown. (Yeah, I know....my last post may have condradicted this but its not what I meant...sorry)
The problem lies entirely with the original PSD file....if the OP changes all the frames to 'Automatic' and re-saves the gif then everything will be fine.
The 'gif' posted by the OP has the error embedded in it....its flattened the layers using each layers unique mask.
Each layer in the 'gif' is now a RESULT of the masks AND the 'Do Not Dispose' setting.....each layer not only contains itself but all those preceding it.
Editing the 'gif' is not an option.....the 'error' is now on each layer.
Editing the original PSD file is the easiest way to correct the problem.
If you want the masking practice then by all means you could open the 'GIF' image and re-mask all the layers AGAIN to remove the unwanted pixels and re-save it again as another GIF......but why bother with all that when you could just re-save the gif from the original PSD file with the correct settings?
If we had the complete original PSD file it could be solved in seconds.....as per my example with the only PSD file the OP has supplied.
Sorry if my previous post was confusing.
Regards.
MrTom.