From 0812f507e3941cf93075378858ccf747c8aeb241 Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Wed, 12 Mar 2014 22:06:28 +0000 Subject: Fix handling of top two pixel rows in be_blur_c 5dd56af2 replaced our implementation of \be with xy-VSFilter's. This error is not present in the xy-VSFilter code; it was introduced by accident in a merge that was later squashed as part of 5dd56af2. Note: the new \be reads in but does not write out the first and last row and column of pixels. --- libass/ass_bitmap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c index f214651..33f06c4 100644 --- a/libass/ass_bitmap.c +++ b/libass/ass_bitmap.c @@ -436,7 +436,7 @@ void be_blur_c(uint8_t *buf, intptr_t w, { unsigned short *col_pix_buf = tmp; unsigned short *col_sum_buf = tmp + w * sizeof(unsigned short); - unsigned x, y, old_pix, old_sum, new_sum, temp1, temp2; + unsigned x, y, old_pix, old_sum, temp1, temp2; unsigned char *src, *dst; memset(col_pix_buf, 0, w * sizeof(unsigned short)); memset(col_sum_buf, 0, w * sizeof(unsigned short)); @@ -456,9 +456,10 @@ void be_blur_c(uint8_t *buf, intptr_t w, col_pix_buf[x] = temp1; } } - new_sum = 2 * buf[y * stride + w - 1]; - buf[y * stride + w - 1] = (old_sum + new_sum) >> 2; { + y = 1; + src=buf+y*stride; + x = 2; old_pix = src[x-1]; old_sum = old_pix + src[x-2]; -- cgit v1.2.3