changeset 25747:12970064a271

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
author benoit
date Thu, 17 Jan 2008 08:06:09 +0000
parents 330af0160c2d
children 28a006b3d912
files libswscale/swscale.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libswscale/swscale.c	Thu Jan 17 02:18:49 2008 +0000
+++ b/libswscale/swscale.c	Thu Jan 17 08:06:09 2008 +0000
@@ -2959,12 +2959,17 @@
                                         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;