[vlc-devel] commit: mac text renderer: Fix a nasty crash in the YUVA renderer ( Derk-Jan Hartman )

git version control git at videolan.org
Sun Jun 21 23:38:06 CEST 2009


vlc | branch: 1.0-bugfix | Derk-Jan Hartman <hartman at videolan.org> | Sun Jun 21 23:36:05 2009 +0200| [e2a691966224cae7d5871a8d5040d5a9aaf4aeb1] | committer: Derk-Jan Hartman 

mac text renderer: Fix a nasty crash in the YUVA renderer

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.
(cherry picked from commit ee313399d56715b1300e76e9738bceb4b59b703b)

Signed-off-by: Derk-Jan Hartman <hartman at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e2a691966224cae7d5871a8d5040d5a9aaf4aeb1
---

 modules/misc/quartztext.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/misc/quartztext.c b/modules/misc/quartztext.c
index b30b5a5..b65ab64 100644
--- a/modules/misc/quartztext.c
+++ b/modules/misc/quartztext.c
@@ -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 ];




More information about the vlc-devel mailing list