]> git.sesse.net Git - vlc/commitdiff
mac text renderer: Fix a nasty crash in the YUVA renderer
authorDerk-Jan Hartman <hartman@videolan.org>
Sun, 21 Jun 2009 21:36:05 +0000 (23:36 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Sun, 21 Jun 2009 21:36:05 +0000 (23:36 +0200)
This really fixes #2649
This entire module needs some refinement, but since we are gonna have to dump it for CoreText very soon, there is little point in doing that.

modules/misc/quartztext.c

index 6b2e0adc50327e6d2a6d9f2aaedd43aa0e45ddee..4e80fa80c386f1eb20aaa7c881c2a7ecadd15060 100644 (file)
@@ -864,10 +864,10 @@ static int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region, UniCha
     p_dst_a = p_region->p_picture->A_PIXELS;
     i_pitch = p_region->p_picture->A_PITCH;
 
-    i_offset = VERTICAL_MARGIN *i_pitch;
-    for( y=0; y<i_textblock_height; y++)
+    i_offset = (i_height+VERTICAL_MARGIN < fmt.i_height) ? VERTICAL_MARGIN *i_pitch : 0 ;
+    for( y=0; y<fmt.i_height; y++)
     {
-        for( x=0; x<i_width; x++)
+        for( x=0; x<fmt.i_width; x++)
         {
             int i_alpha = p_offScreen->p_data[ y * p_offScreen->i_bytesPerRow + x * p_offScreen->i_bytesPerPixel     ];
             int i_red   = p_offScreen->p_data[ y * p_offScreen->i_bytesPerRow + x * p_offScreen->i_bytesPerPixel + 1 ];