提交 c4e2b826 编写于 作者: M Martin Storsjö

In planarCopyWrapper, Only copy length, not stride of the last line in the plane

If the destination planes are offset within the destination buffer,
writing the extra bytes at the end may write outside of the destination
buffer.

Originally committed as revision 31746 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
上级 66b84e4a
......@@ -1663,9 +1663,11 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[
srcPtr+= srcStride[plane];
dstPtr+= dstStride[plane];
}
} else if (dstStride[plane]==srcStride[plane] && srcStride[plane] > 0)
memcpy(dst[plane] + dstStride[plane]*y, src[plane], height*dstStride[plane]);
else {
} else if (dstStride[plane]==srcStride[plane] && srcStride[plane] > 0) {
if (height > 0)
memcpy(dst[plane] + dstStride[plane]*y, src[plane],
(height - 1)*dstStride[plane] + length);
} else {
if(is16BPS(c->srcFormat) && is16BPS(c->dstFormat))
length*=2;
for (i=0; i<height; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册