diff --git a/libswscale/utils.c b/libswscale/utils.c index 71456db580..cb78c5981a 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -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);