summaryrefslogtreecommitdiff
path: root/libavfilter/drawutils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-08-09 12:22:15 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-08-09 12:42:57 +0200
commit369ed11e3c8acc08db39fb2ed4e980a918cab61e (patch)
tree996c90495a7da21ffbad6deb59fa013eb29858b3 /libavfilter/drawutils.c
parent011837285ffc681251d7aa133859499d35381b11 (diff)
downloadffmpeg-369ed11e3c8acc08db39fb2ed4e980a918cab61e.tar.gz
avfilter/drawutils: Fix single plane with alpha
Fixes Ticket5720 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter/drawutils.c')
-rw-r--r--libavfilter/drawutils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index e533040204..8153fdebb7 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -450,6 +450,7 @@ void ff_blend_rectangle(FFDrawContext *draw, FFDrawColor *color,
alpha = 0x101 * color->rgba[3] + 0x2;
}
nb_planes = draw->nb_planes - !!(draw->desc->flags & AV_PIX_FMT_FLAG_ALPHA);
+ nb_planes += !nb_planes;
for (plane = 0; plane < nb_planes; plane++) {
nb_comp = draw->pixelstep[plane];
p0 = pointer_at(draw, dst, dst_linesize, plane, x0, y0);
@@ -627,6 +628,7 @@ void ff_blend_mask(FFDrawContext *draw, FFDrawColor *color,
alpha = (0x101 * color->rgba[3] + 0x2) >> 8;
}
nb_planes = draw->nb_planes - !!(draw->desc->flags & AV_PIX_FMT_FLAG_ALPHA);
+ nb_planes += !nb_planes;
for (plane = 0; plane < nb_planes; plane++) {
nb_comp = draw->pixelstep[plane];
p0 = pointer_at(draw, dst, dst_linesize, plane, x0, y0);