]> granicus.if.org Git - libass/commitdiff
Fix handling of top two pixel rows in be_blur_c
authorOleg Oshmyan <chortos@inbox.lv>
Wed, 12 Mar 2014 22:06:28 +0000 (22:06 +0000)
committerOleg Oshmyan <chortos@inbox.lv>
Thu, 13 Mar 2014 00:31:07 +0000 (00:31 +0000)
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

index f2146519156b8722cd1adbbc4b80f130fa7cb90b..33f06c40f87b908a50d02523fbce4a31b6e5fa61 100644 (file)
@@ -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];