aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale/swscale.c
diff options
context:
space:
mode:
authorCédric Schieli <cschieli@gmail.com>2009-03-17 19:51:52 +0000
committerCédric Schieli <cschieli@gmail.com>2009-03-17 19:51:52 +0000
commit4c01b868de80e94a5619370e02f8d45dde4007b7 (patch)
treece616947d628e4b79614b3fad93ccaf055285b53 /libswscale/swscale.c
parent79ff11d78f260203588e9fbb0be9d22143337bc3 (diff)
downloadffmpeg-4c01b868de80e94a5619370e02f8d45dde4007b7.tar.gz
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
Diffstat (limited to 'libswscale/swscale.c')
-rw-r--r--libswscale/swscale.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index c6012c15b7..8728e2bb6c 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -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
{