OSDN Git Service

avcodec/x86/pngdsp: fix off by 1 error
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 7 Dec 2014 11:28:37 +0000 (12:28 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 8 Dec 2014 17:24:40 +0000 (18:24 +0100)
This fixes artifacts in the last pixel of rows with some widths and pixel formats

Found-by: Dominique Leroux <Dominique.Leroux@autodesk.com>
Tested-by: Dominique Leroux <Dominique.Leroux@autodesk.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/pngdec.c
libavcodec/x86/pngdsp.asm

index 60acd3f..bc32eab 100644 (file)
@@ -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;
             }
         }
index 678a032..7bd1ab5 100644 (file)
@@ -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