From ee0a8bcba145d7dbdcb86c77b93510b7fb7447e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Sat, 9 Mar 2013 23:52:30 +0100 Subject: lavfi/showspectrum: fix outpicref initialization. In 81f2549, output pixel format was changed from rgb24 to planar yuv, but the initialization was left unchanged. As a result, the chroma planes were left uninitalized. This was not noticed since the current ff_get_video_buffer() seems to be initializing the buffer. This won't be the case anymore after the Evil Plan. --- libavfilter/avf_showspectrum.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c index bb8b62f68d..57b4a4d87e 100644 --- a/libavfilter/avf_showspectrum.c +++ b/libavfilter/avf_showspectrum.c @@ -226,7 +226,9 @@ static int config_output(AVFilterLink *outlink) if (!outpicref) return AVERROR(ENOMEM); outlink->sample_aspect_ratio = (AVRational){1,1}; - memset(outpicref->data[0], 0, outlink->h * outpicref->linesize[0]); + memset(outpicref->data[0], 0, outlink->h * outpicref->linesize[0]); + memset(outpicref->data[1], 128, outlink->h * outpicref->linesize[1]); + memset(outpicref->data[2], 128, outlink->h * outpicref->linesize[2]); } if (showspectrum->xpos >= outlink->w) -- cgit v1.2.3