Files
ffmpeg/libavcodec
Andreas Rheinhardt dd80066c97 avcodec/movtextdec: Fix immediately adjacent styles
The checks for whether a style should be opened/closed at the current
character position are as follows: A variable entry contained the index
of the currently active or potentially next active style. If the current
character position coincided with the start of style[entry], the style
was activated; this was followed by a check whether the current
character position coincided with the end of style[entry]; if so, the
style was deactivated and entry incremented. Afterwards the char was
processed.

The order of the checks leads to problems in case the endChar of style A
coincides with the startChar of the next style (say B): Style B was never
opened. When we are at said common position, the currently active style
is A and so the start pos check does not succeed; but the end pos check
does and it closes the currently active style A and increments entry.
At the next iteration of the loop, the current character position is
bigger than the start position of style B (which is style[entry]) and
therefore the style is not activated.

The solution is of course to first check for whether a style needs to be
closed (and increment entry if it does) before checking whether the next
style needs to be opened.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-10-19 05:03:39 +02:00
..
2020-09-18 11:34:11 +02:00
2020-10-15 22:53:56 +02:00
2020-10-07 22:16:09 +02:00
2020-10-07 22:16:09 +02:00
2020-10-07 22:16:09 +02:00
2020-10-15 21:20:40 +02:00
2020-10-15 22:30:13 -04:00
2020-10-15 22:53:56 +02:00
2020-10-15 21:20:40 +02:00
2020-10-16 00:38:50 +02:00