diff options
author | Mans Rullgard <mans@mansr.com> | 2011-11-26 21:53:00 +0000 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2011-11-26 22:53:47 +0000 |
commit | 7c5ce99bd92fb480b7235cbc9a005f7e6d31f1d7 (patch) | |
tree | f22a4994d1a41a0f921bf4936769a542a0c592c3 /libswscale/swscale.c | |
parent | 8540dcfd7af14da4080770dfbfa997cffdd0878b (diff) | |
download | ffmpeg-7c5ce99bd92fb480b7235cbc9a005f7e6d31f1d7.tar.gz |
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: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libswscale/swscale.c')
-rw-r--r-- | libswscale/swscale.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 98daf22cbd..975a0bdf1f 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -510,7 +510,7 @@ yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter, const uint8_t * const d128=dither_8x8_220[y&7]; uint8_t *g = c->table_gU[128] + c->table_gV[128]; int i; - int acc = 0; + unsigned acc = 0; for (i = 0; i < dstW - 1; i += 2) { int j; |