aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-31 14:42:53 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-03 03:40:58 +0200
commit9a840d5e1745a4f1408633a1d086471fcf3654a2 (patch)
tree64f63f3b683c8639100aace0194a9e2d56205847
parent9e43d92d6a16417aa06b62f0375212d528d1a484 (diff)
downloadffmpeg-9a840d5e1745a4f1408633a1d086471fcf3654a2.tar.gz
avcodec/mjpegdec: fix green vertical line at the right with upscale h
Fixes Ticket3891 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 63a52ca134dc4ee648a547c7c410d547f371b481) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/mjpegdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 19fd9293a7..b839e583ef 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -2096,8 +2096,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