summaryrefslogtreecommitdiff
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 17:39:04 +0100
commitc1521dd418db3ad63019a7f7f2bbc985a3adf31c (patch)
treed1bc210dd5801eea76ef0892f7338911c89162eb
parenta5b4b807757fda3dc920d4b23599f8391c21409b (diff)
downloadffmpeg-c1521dd418db3ad63019a7f7f2bbc985a3adf31c.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>
-rw-r--r--libswscale/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 4d91f2d4a8..b496b8f525 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1521,6 +1521,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);