avcodec/mjpegdec: Fix chroma width rounding
authorClément Bœsch <clement@stupeflix.com>
Sat, 13 Sep 2014 18:25:27 +0000 (20:25 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Sat, 1 Nov 2014 14:51:41 +0000 (15:51 +0100)
Fixes vertical line at the right side
Fixes Ticket 3929

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b96d864fd685aa1f661a5f8666224129d68b8eaf)

libavcodec/mjpegdec.c

index 6a02527..b29b340 100644 (file)
@@ -2128,7 +2128,7 @@ the_end:
             if (!(s->upscale_v & (1<<p)))
                 continue;
             if (p==1 || p==2)
-                w >>= hshift;
+                w = FF_CEIL_RSHIFT(w, hshift);
             for (i = s->height - 1; i; i--) {
                 uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[p])[i / 2 * s->linesize[p]];
                 uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[p])[(i + 1) / 2 * s->linesize[p]];