From fb9c400ac2104c5666ce096f3bc594c19405ac9b Mon Sep 17 00:00:00 2001 From: michael Date: Thu, 17 Jul 2008 22:01:18 +0000 Subject: Ensure that exactly one scaler algo is used. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27317 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'libswscale') diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 60f11d6eb6..fd6aeb2a71 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2014,6 +2014,23 @@ SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH return NULL; } + i= flags & ( SWS_POINT + |SWS_AREA + |SWS_FAST_BILINEAR + |SWS_BICUBIC + |SWS_X + |SWS_GAUSS + |SWS_LANCZOS + |SWS_SINC + |SWS_SPLINE + |SWS_BICUBLIN); + if(!i || (i & (i-1))) + { + av_log(NULL, AV_LOG_ERROR, "swScaler: Exactly one scaler algorithm must be choosen\n"); + return NULL; + } + + /* sanity check */ 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 { -- cgit v1.2.3