aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-31 14:42:53 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-31 15:16:36 +0200
commit63a52ca134dc4ee648a547c7c410d547f371b481 (patch)
tree625558987f0a34e7eb74a06b082429395951cc22 /libavcodec
parent6d7aa437e1108dd8142ae5b850a00c109f95f07f (diff)
downloadffmpeg-63a52ca134dc4ee648a547c7c410d547f371b481.tar.gz
avcodec/mjpegdec: fix green vertical line at the right with upscale h
Fixes Ticket3891 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mjpegdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index b6e0e68391..ac898bb432 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -2097,8 +2097,11 @@ the_end:
continue;
if (p==1 || p==2)
w >>= hshift;
+ av_assert0(w > 0);
for (i = 0; i < s->chroma_height; i++) {
- for (index = w - 1; index; index--) {
+ if (is16bit) ((uint16_t*)line)[w - 1] = ((uint16_t*)line)[(w - 1) / 2];
+ else line[w - 1] = line[(w - 1) / 2];
+ for (index = w - 2; index > 0; index--) {
if (is16bit)
((uint16_t*)line)[index] = (((uint16_t*)line)[index / 2] + ((uint16_t*)line)[(index + 1) / 2]) >> 1;
else