# HG changeset patch # User greg # Date 1236526227 0 # Node ID b9edcb7200e7f856de467e000d3da1f253c59d26 # Parent 07c168210a73dcae753fe5a89c063375e90c0e8d Don't assume width == stride for bitmap composition. Fixes http://bugzilla.mplayerhq.hu/show_bug.cgi?id=1421 diff -r 07c168210a73 -r b9edcb7200e7 libass/ass_render.c --- a/libass/ass_render.c Sun Mar 08 15:20:14 2009 +0000 +++ b/libass/ass_render.c Sun Mar 08 15:30:27 2009 +0000 @@ -423,10 +423,12 @@ int ax = (*last_tail)->dst_x; int ay = (*last_tail)->dst_y; int aw = (*last_tail)->w; + int as = (*last_tail)->stride; int ah = (*last_tail)->h; int bx = (*tail)->dst_x; int by = (*tail)->dst_y; int bw = (*tail)->w; + int bs = (*tail)->stride; int bh = (*tail)->h; unsigned char* a; unsigned char* b; @@ -472,16 +474,16 @@ // Allocate new bitmaps and copy over data a = (*last_tail)->bitmap; b = (*tail)->bitmap; - (*last_tail)->bitmap = malloc(aw*ah); - (*tail)->bitmap = malloc(bw*bh); - memcpy((*last_tail)->bitmap, a, aw*ah); - memcpy((*tail)->bitmap, b, bw*bh); + (*last_tail)->bitmap = malloc(as*ah); + (*tail)->bitmap = malloc(bs*bh); + memcpy((*last_tail)->bitmap, a, as*ah); + memcpy((*tail)->bitmap, b, bs*bh); // Composite overlapping area for (y=0; y b[cpos]) ? a[opos] : b[cpos]; (*last_tail)->bitmap[opos] = 0; (*tail)->bitmap[cpos] = m;