diff options
author | benoit <benoit@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-01-17 08:06:09 +0000 |
---|---|---|
committer | benoit <benoit@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-01-17 08:06:09 +0000 |
commit | 6e8c03910d32063e1c776fbf8942a7877dfded47 (patch) | |
tree | 15c0a85f26a22c476204b7684c6ecb99d4ea3084 | |
parent | 969bc9cb89d22d9ed21a355c209a94f65eff67cf (diff) |
Check param in sws_getCachedContext().
Patch by KO Myung-Hun komh chollian net
Original thread: [FFmpeg-devel] [PATCH] param check in sws_getCachedContext()
Date: Wed Jan 9 11:15:19 CET 2008
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25775 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libswscale/swscale.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index a68d2b881b..05e1def3c8 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2959,12 +2959,17 @@ struct SwsContext *sws_getCachedContext(struct SwsContext *context, int dstW, int dstH, int dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, double *param) { + static const double default_param[2] = {SWS_PARAM_DEFAULT, SWS_PARAM_DEFAULT}; + + if (!param) + param = default_param; + if (context != NULL) { if ((context->srcW != srcW) || (context->srcH != srcH) || (context->srcFormat != srcFormat) || (context->dstW != dstW) || (context->dstH != dstH) || (context->dstFormat != dstFormat) || (context->flags != flags) || - (context->param != param)) + (context->param[0] != param[0]) || (context->param[1] != param[1])) { sws_freeContext(context); context = NULL; |