aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-02-15 21:42:01 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-02-15 21:42:01 +0000
commit805d0232c5d5d1015959509a68fbfc526c518810 (patch)
tree676f3f45a04e1848ccd188313ed0358bca7f3f80
parente9f54274c7677f4378f24dd65ce8c98014c344d9 (diff)
downloadffmpeg-805d0232c5d5d1015959509a68fbfc526c518810.tar.gz
Do not copy more data than needed
Commited in SoC by Vitor Sessak on 2008-02-15 21:11:35 Originally committed as revision 12061 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavfilter/avfilter.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 2582276f89..0182e47018 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -20,6 +20,7 @@
*/
#include "avfilter.h"
+#include "imgconvert.h"
/** list of registered filters */
struct FilterList
@@ -261,10 +262,13 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h)
}
for(i = 0; i < 4; i ++) {
+ int planew =
+ ff_get_plane_bytewidth(link->format, link->cur_pic->w, i);
+
if(!src[i]) continue;
for(j = 0; j < h >> (i==0 ? 0 : vsub); j ++) {
- memcpy(dst[i], src[i], link->cur_pic->linesize[i]);
+ memcpy(dst[i], src[i], planew);
src[i] += link->srcpic ->linesize[i];
dst[i] += link->cur_pic->linesize[i];
}