summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-02-01 15:32:21 +0100
committerAnton Khirnov <anton@khirnov.net>2012-02-08 21:01:31 +0100
commit38d553322891c8e47182f05199d19888422167dc (patch)
treec65ae36daf4d68dfdbea62accc7f33630cc338f5 /libavfilter
parent8e37038a3458e6b55c9ebc28f077e2119a41b59e (diff)
pixdesc: mark pseudopaletted formats with a special flag.
This makes it possible to dintinguish them from PAL8. Fixes an invalid write in avpicture_layout().
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_crop.c3
-rw-r--r--libavfilter/vf_pixdesctest.c3
-rw-r--r--libavfilter/vf_scale.c3
3 files changed, 6 insertions, 3 deletions
diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c
index 0880d4e5f9..cb01bd41cb 100644
--- a/libavfilter/vf_crop.c
+++ b/libavfilter/vf_crop.c
@@ -272,7 +272,8 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
ref2->data[0] += crop->y * ref2->linesize[0];
ref2->data[0] += crop->x * crop->max_step[0];
- if (!(av_pix_fmt_descriptors[link->format].flags & PIX_FMT_PAL)) {
+ if (!(av_pix_fmt_descriptors[link->format].flags & PIX_FMT_PAL ||
+ av_pix_fmt_descriptors[link->format].flags & PIX_FMT_PSEUDOPAL)) {
for (i = 1; i < 3; i ++) {
if (ref2->data[i]) {
ref2->data[i] += (crop->y >> crop->vsub) * ref2->linesize[i];
diff --git a/libavfilter/vf_pixdesctest.c b/libavfilter/vf_pixdesctest.c
index 344f6648f1..cf7dfeda3e 100644
--- a/libavfilter/vf_pixdesctest.c
+++ b/libavfilter/vf_pixdesctest.c
@@ -72,7 +72,8 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
}
/* copy palette */
- if (priv->pix_desc->flags & PIX_FMT_PAL)
+ if (priv->pix_desc->flags & PIX_FMT_PAL ||
+ priv->pix_desc->flags & PIX_FMT_PSEUDOPAL)
memcpy(outpicref->data[1], outpicref->data[1], 256*4);
avfilter_start_frame(outlink, avfilter_ref_buffer(outpicref, ~0));
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index dd2f7e18a5..37a6f8e386 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -208,7 +208,8 @@ static int config_props(AVFilterLink *outlink)
outlink->w, outlink->h, av_pix_fmt_descriptors[outlink->format].name,
scale->flags);
- scale->input_is_pal = av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PAL;
+ scale->input_is_pal = av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PAL ||
+ av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PSEUDOPAL;
if (scale->sws)
sws_freeContext(scale->sws);