On Thu, Nov 3, 2011 at 4:11 PM, Ronald S. Bultje <[email protected]> wrote: > Hi, > > On Thu, Nov 3, 2011 at 4:03 PM, Alex Converse <[email protected]> wrote: >> --- >> 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])); > > Can you elaborate? Does sizeof() return the size of the whole struct? > That would be worrisome. >
pic->data and pic->linesize each contain 8 elements. Only the first 4 are used by video. http://git.libav.org/?p=libav.git;a=commitdiff;h=56b5e9d5a90a10a1b7d6abc53674c43214d462d0;hp=ecc7bfe30c595cbe14a2b77db647e9fec1bc5d79 _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
