[SCM] libav/experimental: Don't write outside of the picture buffer in planarCopy in the gray case
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 30 16:41:36 UTC 2013
The following commit has been merged in the experimental branch:
commit 4c01b868de80e94a5619370e02f8d45dde4007b7
Author: Cédric Schieli <cschieli at gmail.com>
Date: Tue Mar 17 19:51:52 2009 +0000
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
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index c6012c1..8728e2b 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
{
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list