Regarding the picture errors, DGMPGDec does not support MKV files! It is derived from
jackei's DVD2AVI, which worked with DVDs so started off in life supporting only VOB. It was subsequently enhanced by others to support elementary streams, program streams (.mpg), and transport streams. For MKV support you need the DGDecNV variant. Do not rip to MKV if you want to use DGMPGDec. Or demux them and load the M2V elementary stream in your script.
BTW,
jackei is the guy who first figured out how to do TFF/RFF handling (and force film) correctly. He's a legend.
It sort of plays for a while before crashing but that is just luck. I should add a check to reject MKVs. It also might help to mention in the user manual what stream types are accepted.

In our defense, realize that back then MKV did not yet exist.
While many still use DGMPGDec for DVDs it's hardly a state-of-the-art solution these days. However, it still works well in its domain and stands as an open-source example of how to do TFF/RFF correctly, which I understand is your motivation here. There should be no excuse for flubbing that.
OT: You should seriously consider switching to an nVidia card. You won't regret it! It's kinda like when I finally ditched my flip phone for a smart phone. Why did I wait so long?! People were laughing at me.