Commit 7c5ce99b authored by Mans Rullgard's avatar Mans Rullgard

swscale: fix signed overflow in yuv2mono_X_c_template

As old bits are shifted out of the accumulator, they cause signed
overflows when they reach the end.  Making the variable unsigned fixes
this.
Signed-off-by: 's avatarMans Rullgard <mans@mansr.com>
parent 8540dcfd
...@@ -510,7 +510,7 @@ yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter, ...@@ -510,7 +510,7 @@ yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter,
const uint8_t * const d128=dither_8x8_220[y&7]; const uint8_t * const d128=dither_8x8_220[y&7];
uint8_t *g = c->table_gU[128] + c->table_gV[128]; uint8_t *g = c->table_gU[128] + c->table_gV[128];
int i; int i;
int acc = 0; unsigned acc = 0;
for (i = 0; i < dstW - 1; i += 2) { for (i = 0; i < dstW - 1; i += 2) {
int j; int j;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment