[libav-devel] [PATCH 1/5] avfilter: Don't copy garbage from the stack when setting up video pictures.

Alex Converse alex.converse at gmail.com
Fri Nov 4 00:03:22 CET 2011


---
 libavfilter/avfilter.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index abeae14..2f24aa3 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -332,8 +332,8 @@ avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], int linesize[4], int
     picref->type = AVMEDIA_TYPE_VIDEO;
     pic->format = picref->format = format;
 
-    memcpy(pic->data,        data,          sizeof(pic->data));
-    memcpy(pic->linesize,    linesize,      sizeof(pic->linesize));
+    memcpy(pic->data,        data,          4*sizeof(data[0]));
+    memcpy(pic->linesize,    linesize,      4*sizeof(linesize[0]));
     memcpy(picref->data,     pic->data,     sizeof(picref->data));
     memcpy(picref->linesize, pic->linesize, sizeof(picref->linesize));
 
-- 
1.7.3.1



More information about the libav-devel mailing list