aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-12-24 21:46:15 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-01-15 16:00:31 +0100
commitd41b91ba33a52f8deac4d2e35b698b360de5666c (patch)
treee8eacb0500f6430b462dc3c7e06fb4c5fe8fd7ac /libswscale
parent34c5f6685a866f371e7edda2dcf17b9db25bc71e (diff)
downloadffmpeg-d41b91ba33a52f8deac4d2e35b698b360de5666c.tar.gz
swscale/utils: Fix intermediate format for cascaded alpha downscaling
Fixes Ticket4926 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b83d8be6bff7d645469a623aee0b380541da15cf) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 93cbad79c9..cc6402d4c8 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1598,6 +1598,9 @@ fail: // FIXME replace things by appropriate error codes
int tmpH = sqrt(srcH * (int64_t)dstH);
enum AVPixelFormat tmpFormat = AV_PIX_FMT_YUV420P;
+ if (isALPHA(srcFormat))
+ tmpFormat = AV_PIX_FMT_YUVA420P;
+
if (srcW*(int64_t)srcH <= 4LL*dstW*dstH)
return AVERROR(EINVAL);