comparison libswscale/swscale.c @ 27285:99a489828840

Ensure that exactly one scaler algo is used.
author michael
date Thu, 17 Jul 2008 22:01:18 +0000
parents 18fc658de355
children 26d7759b977d
comparison
equal deleted inserted replaced
27284:3a1a148a9633 27285:99a489828840
2012 { 2012 {
2013 av_log(NULL, AV_LOG_ERROR, "swScaler: %s is not supported as output pixel format\n", sws_format_name(dstFormat)); 2013 av_log(NULL, AV_LOG_ERROR, "swScaler: %s is not supported as output pixel format\n", sws_format_name(dstFormat));
2014 return NULL; 2014 return NULL;
2015 } 2015 }
2016 2016
2017 i= flags & ( SWS_POINT
2018 |SWS_AREA
2019 |SWS_FAST_BILINEAR
2020 |SWS_BICUBIC
2021 |SWS_X
2022 |SWS_GAUSS
2023 |SWS_LANCZOS
2024 |SWS_SINC
2025 |SWS_SPLINE
2026 |SWS_BICUBLIN);
2027 if(!i || (i & (i-1)))
2028 {
2029 av_log(NULL, AV_LOG_ERROR, "swScaler: Exactly one scaler algorithm must be choosen\n");
2030 return NULL;
2031 }
2032
2033
2017 /* sanity check */ 2034 /* sanity check */
2018 if (srcW<4 || srcH<1 || dstW<8 || dstH<1) //FIXME check if these are enough and try to lowwer them after fixing the relevant parts of the code 2035 if (srcW<4 || srcH<1 || dstW<8 || dstH<1) //FIXME check if these are enough and try to lowwer them after fixing the relevant parts of the code
2019 { 2036 {
2020 av_log(NULL, AV_LOG_ERROR, "swScaler: %dx%d -> %dx%d is invalid scaling dimension\n", 2037 av_log(NULL, AV_LOG_ERROR, "swScaler: %dx%d -> %dx%d is invalid scaling dimension\n",
2021 srcW, srcH, dstW, dstH); 2038 srcW, srcH, dstW, dstH);