summaryrefslogtreecommitdiff
path: root/libavcodec/pngdec.c
diff options
context:
space:
mode:
authorDonny Yang <work@kota.moe>2015-06-02 15:49:26 +0000
committerMichael Niedermayer <michaelni@gmx.at>2015-06-08 16:18:34 +0200
commit33292c07fe19f959d9ea7ad1c24de427da110ba2 (patch)
treefd355f13c3f1bea1a454ddf97419c0ba423bcab5 /libavcodec/pngdec.c
parent0ab1c46fe07ff9637ddc67b9b2270a73f1391c9b (diff)
avcodec/apng: Add support for blending with GRAY8A pixel format
Signed-off-by: Donny Yang <work@kota.moe> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pngdec.c')
-rw-r--r--libavcodec/pngdec.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index fa69c87732..88b0152ece 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -896,7 +896,8 @@ static int handle_p_frame_apng(AVCodecContext *avctx, PNGDecContext *s,
return AVERROR(ENOMEM);
if (s->blend_op == APNG_BLEND_OP_OVER &&
- avctx->pix_fmt != AV_PIX_FMT_RGBA) {
+ avctx->pix_fmt != AV_PIX_FMT_RGBA &&
+ avctx->pix_fmt != AV_PIX_FMT_GRAY8A) {
avpriv_request_sample(avctx, "Blending with pixel format %s",
av_get_pix_fmt_name(avctx->pix_fmt));
return AVERROR_PATCHWELCOME;
@@ -942,6 +943,11 @@ static int handle_p_frame_apng(AVCodecContext *avctx, PNGDecContext *s,
foreground_alpha = foreground[3];
background_alpha = background[3];
break;
+
+ case AV_PIX_FMT_GRAY8A:
+ foreground_alpha = foreground[1];
+ background_alpha = background[1];
+ break;
}
if (foreground_alpha == 0)