Commit b10fcd89 authored by sdrik's avatar sdrik

Don't write outside of the picture buffer in planarCopy in the gray case

git-svn-id: file:///var/local/repositories/mplayer/trunk/libswscale@28985 b3059339-0415-0410-9bf9-f77b7e298cf2
parent 5206a850
......@@ -1934,8 +1934,14 @@ static int planarCopy(SwsContext *c, uint8_t* src[], int srcStride[], int srcSli
if ((isGray(c->srcFormat) || isGray(c->dstFormat)) && plane>0)
{
if (!isGray(c->dstFormat))
memset(dst[plane], 128, dstStride[plane]*height);
if (!isGray(c->dstFormat)){
int i;
uint8_t *ptr = dst[plane] + dstStride[plane]*y;
for (i=0; i<height; i++){
memset(ptr, 128, length);
ptr += dstStride[plane];
}
}
}
else
{
......
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