summaryrefslogtreecommitdiff
path: root/libswscale/swscale.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-07-17 22:01:18 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-07-17 22:01:18 +0000
commit010c00bc81da252aaa16b50460da5c4a16d72068 (patch)
tree5b85e2d9d12e047e14755fbf0c21c318a7305285 /libswscale/swscale.c
parentfbbea48eb35789b9fb571dea45401be8cc2a311a (diff)
Ensure that exactly one scaler algo is used.
Originally committed as revision 27317 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
Diffstat (limited to 'libswscale/swscale.c')
-rw-r--r--libswscale/swscale.c17
1 files changed, 17 insertions, 0 deletions
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
{