Commit ed9be7dd authored by Michael Niedermayer's avatar 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: 's avatarDominique Leroux <Dominique.Leroux@autodesk.com>
Tested-by: 's avatarDominique Leroux <Dominique.Leroux@autodesk.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 41a52740
......@@ -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;
}
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment