Don't write outside of the picture buffer in planarCopy in the gray case
Originally committed as revision 28985 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
This commit is contained in:
parent
79ff11d78f
commit
4c01b868de
@ -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->srcFormat) || isGray(c->dstFormat)) && plane>0)
|
||||||
{
|
{
|
||||||
if (!isGray(c->dstFormat))
|
if (!isGray(c->dstFormat)){
|
||||||
memset(dst[plane], 128, dstStride[plane]*height);
|
int i;
|
||||||
|
uint8_t *ptr = dst[plane] + dstStride[plane]*y;
|
||||||
|
for (i=0; i<height; i++){
|
||||||
|
memset(ptr, 128, length);
|
||||||
|
ptr += dstStride[plane];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user