From fce30d8d736f5a77512c7b0b231438062fd12581 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sat, 7 Apr 2012 09:49:39 +0200 Subject: [PATCH] lavfi: copy palette in start_frame() Fix -vf copy with pal8 format. --- libavfilter/video.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavfilter/video.c b/libavfilter/video.c index 5c750ff96a..87a206c326 100644 --- a/libavfilter/video.c +++ b/libavfilter/video.c @@ -230,6 +230,10 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref) link->cur_buf = avfilter_get_video_buffer(link, dst->min_perms, link->w, link->h); link->src_buf = picref; avfilter_copy_buffer_ref_props(link->cur_buf, link->src_buf); + + /* copy palette if required */ + if (av_pix_fmt_descriptors[link->format].flags & PIX_FMT_PAL) + memcpy(link->cur_buf->data[1], link->src_buf-> data[1], AVPALETTE_SIZE); } else link->cur_buf = picref;