[FFmpeg-cvslog] avcodec/x86/pngdsp: fix off by 1 error

Michael Niedermayer git at videolan.org
Mon Dec 8 18:41:33 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Dec  7 12:28:37 2014 +0100| [ed9be7dd470cd32fdb5baa886b048266f4cba28f] | committer: Michael Niedermayer

avcodec/x86/pngdsp: fix off by 1 error

This fixes artifacts in the last pixel of rows with some widths and pixel formats

Found-by: Dominique Leroux <Dominique.Leroux at autodesk.com>
Tested-by: Dominique Leroux <Dominique.Leroux at autodesk.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ed9be7dd470cd32fdb5baa886b048266f4cba28f
---

 libavcodec/pngdec.c       |    2 +-
 libavcodec/x86/pngdsp.asm |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 60acd3f..bc32eab 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -274,7 +274,7 @@ static void png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type,
              * the last pixel with bpp=3 */
             int w = bpp == 4 ? size : size - 3;
             if (w > i) {
-                dsp->add_paeth_prediction(dst + i, src + i, last + i, w - i, bpp);
+                dsp->add_paeth_prediction(dst + i, src + i, last + i, size - i, bpp);
                 i = w;
             }
         }
diff --git a/libavcodec/x86/pngdsp.asm b/libavcodec/x86/pngdsp.asm
index 678a032..7bd1ab5 100644
--- a/libavcodec/x86/pngdsp.asm
+++ b/libavcodec/x86/pngdsp.asm
@@ -157,7 +157,7 @@ cglobal add_png_paeth_prediction, 5, 7, %1, dst, src, top, w, bpp, end, cntr
     movh            [dstq], m3
     add               dstq, bppq
     cmp               dstq, endq
-    jle .loop
+    jl .loop
 
     mov               dstq, [rsp]
     dec              cntrq



More information about the ffmpeg-cvslog mailing list