From 24eac3cff54a5828ba76bc1ad93b99724cde45c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Sun, 8 Apr 2012 16:12:46 +0200 Subject: [PATCH] Mark GRAY8 format as pseudo-paletted. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes that the GIF encoder crashes with it because it has no palette. And the arguments for the pseudopalette apply to gray8 as much as to RGB8 etc. In addition the changes required in lavfi should be needed anyway when adding support for RGB8 etc. Signed-off-by: Reimar Döffinger --- libavfilter/drawutils.c | 2 +- libavfilter/vf_pad.c | 2 +- libavutil/pixdesc.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c index 9b24cf7ac7..954c075a5f 100644 --- a/libavfilter/drawutils.c +++ b/libavfilter/drawutils.c @@ -134,7 +134,7 @@ int ff_draw_init(FFDrawContext *draw, enum PixelFormat format, unsigned flags) if (!desc->name) return AVERROR(EINVAL); - if (desc->flags & ~(PIX_FMT_PLANAR | PIX_FMT_RGB)) + if (desc->flags & ~(PIX_FMT_PLANAR | PIX_FMT_RGB | PIX_FMT_PSEUDOPAL)) return AVERROR(ENOSYS); for (i = 0; i < desc->nb_components; i++) { c = &desc->comp[i]; diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c index 9fc4b39b16..2a3c17ea18 100644 --- a/libavfilter/vf_pad.c +++ b/libavfilter/vf_pad.c @@ -262,7 +262,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0); int plane; - for (plane = 0; plane < 4 && outpicref->data[plane]; plane++) { + for (plane = 0; plane < 4 && outpicref->data[plane] && pad->draw.pixelstep[plane]; plane++) { int hsub = pad->draw.hsub[plane]; int vsub = pad->draw.vsub[plane]; diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 233b217643..8572719822 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -220,6 +220,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { .comp = { { 0, 0, 1, 0, 7 }, /* Y */ }, + .flags = PIX_FMT_PSEUDOPAL, }, [PIX_FMT_MONOWHITE] = { .name = "monow",