[vlc-devel] [PATCH] Fix corrupted rendering of EIA-608 captions

Devin Heitmueller dheitmueller at kernellabs.com
Sun Jan 13 22:53:05 CET 2013

When we moved the code to use the legacy method *or* the new method,
we lost the functionality that actually initialized the memory allocated
for the entire subpicture region (including the part where captions
weren't being rendered.

This was most obvious when regression testing on OSX, where it
resulted in old captions continuing to appear on screen even
after being cleared, or garbage in the render buffer.

Add a line that effectively zeros out the buffer prior to use.
 modules/text_renderer/freetype.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index 99fa521..2295095 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -1180,6 +1180,7 @@ static inline int RenderAXYZ( filter_t *p_filter,
     if (p_region->b_renderbg) {
         /* Render the background just under the text */
+        FillPicture( p_picture, 0x00, 0x00, 0x00, 0x00 );
         RenderBackground(p_region, p_line_head, p_bbox, i_margin, p_picture, i_text_width,
                          ExtractComponents, BlendPixel);
     } else {

More information about the vlc-devel mailing list