swscale/utils: Fix intermediate format for cascaded alpha downscaling
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 24 Dec 2015 20:46:15 +0000 (21:46 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 15 Jan 2016 16:23:54 +0000 (17:23 +0100)
Fixes Ticket4926

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b83d8be6bff7d645469a623aee0b380541da15cf)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libswscale/utils.c

index 71456db..cb78c59 100644 (file)
@@ -1528,6 +1528,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);