[FFmpeg-cvslog] avcodec/mjpegdec: fix green vertical line at the right with upscale h
Michael Niedermayer
git at videolan.org
Fri Oct 3 03:47:44 CEST 2014
ffmpeg | branch: release/2.3 | Michael Niedermayer <michaelni at gmx.at> | Sun Aug 31 14:42:53 2014 +0200| [9a840d5e1745a4f1408633a1d086471fcf3654a2] | committer: Michael Niedermayer
avcodec/mjpegdec: fix green vertical line at the right with upscale h
Fixes Ticket3891
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 63a52ca134dc4ee648a547c7c410d547f371b481)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9a840d5e1745a4f1408633a1d086471fcf3654a2
---
libavcodec/mjpegdec.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 19fd929..b839e58 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
More information about the ffmpeg-cvslog
mailing list