[FFmpeg-cvslog] r12061 - trunk/libavfilter/avfilter.c

vitor subversion
Fri Feb 15 22:42:02 CET 2008


Author: vitor
Date: Fri Feb 15 22:42:01 2008
New Revision: 12061

Log:
Do not copy more data than needed
Commited in SoC by Vitor Sessak on 2008-02-15 21:11:35


Modified:
   trunk/libavfilter/avfilter.c

Modified: trunk/libavfilter/avfilter.c
==============================================================================
--- trunk/libavfilter/avfilter.c	(original)
+++ trunk/libavfilter/avfilter.c	Fri Feb 15 22:42:01 2008
@@ -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 *l
         }
 
         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];
             }




More information about the ffmpeg-cvslog mailing list