avcodec/mjpegdec: fix green line at the bottom with upscale v

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-08-31 15:33:30 +02:00
parent 9a840d5e17
commit f903147f2d

View File

@ -2130,7 +2130,7 @@ the_end:
for (i = s->height - 1; i; i--) { for (i = s->height - 1; i; i--) {
uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[p])[i / 2 * s->linesize[p]]; 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]]; uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[p])[(i + 1) / 2 * s->linesize[p]];
if (src1 == src2) { if (src1 == src2 || i == s->height - 1) {
memcpy(dst, src1, w); memcpy(dst, src1, w);
} else { } else {
for (index = 0; index < w; index++) for (index = 0; index < w; index++)