diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2012-04-04 10:50:29 -0700 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2012-04-04 10:55:50 -0700 |
commit | bc0bdda77b8df4c963dde55793dcecb65232c21a (patch) | |
tree | dae7c492a57b45cb896719b0106fee162d19b0ac /libswscale/input.c | |
parent | e484265c9712dd108c61f21bbc7644a2b791f36f (diff) | |
download | ffmpeg-bc0bdda77b8df4c963dde55793dcecb65232c21a.tar.gz |
swscale: handle complete dimensions for monoblack/white.
Fixes bug 269.
Diffstat (limited to 'libswscale/input.c')
-rw-r--r-- | libswscale/input.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libswscale/input.c b/libswscale/input.c index e636eac1f6..b4855093a0 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -309,7 +309,8 @@ static void monowhite2Y_c(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused) { int i, j; - for (i=0; i<width/8; i++) { + width = (width + 7) >> 3; + for (i = 0; i < width; i++) { int d= ~src[i]; for(j=0; j<8; j++) dst[8*i+j]= ((d>>(7-j))&1)*255; @@ -320,7 +321,8 @@ static void monoblack2Y_c(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused) { int i, j; - for (i=0; i<width/8; i++) { + width = (width + 7) >> 3; + for (i = 0; i < width; i++) { int d= src[i]; for(j=0; j<8; j++) dst[8*i+j]= ((d>>(7-j))&1)*255; |