subtitle2pgm sometimes (approx. 5-10 times per DVD) produces duplicated images for one subtitle line. The duplicate image replaces the previous or next subtitle image, therefore it is lost.
Example:
Let's have a following subtitles on DVD:
1
Subtitle text1.
2
Subtitle text2.
3
Subtitle text3.
4
Subtitle text4.
After conversion to pgm, we get following images:
1
Subtitle text1.
2
Subtitle text3.
3
Subtitle text3.
4
Subtitle text4.
"Subtitle text3." was duplicated and "Subtitle text2." was lost.
The bug is described also in forums by Alexander Yu (https://sourceforge.net/forum/forum.php?thread_id=1022563&forum_id=158520) with a patch. I've tested it and it works for me and fixes described bug.
I'm attaching same patch (in other format).
Patch that fixes dupliaction of subtitles.