]> git.sesse.net Git - ffmpeg/blobdiff - libswscale/utils.c
ff_msmpeg4_decode_init() calls ff_h263_decode_init() which calls
[ffmpeg] / libswscale / utils.c
index eebd40c79a975459e7c7544c4b3364dc50462a33..99bc663840c085de16a77e85922a12c269b6d5f3 100644 (file)
@@ -1566,17 +1566,20 @@ struct SwsContext *sws_getCachedContext(struct SwsContext *context,
     if (!param)
         param = default_param;
 
-    if (context) {
-        if (context->srcW != srcW || context->srcH != srcH ||
-            context->srcFormat != srcFormat ||
-            context->dstW != dstW || context->dstH != dstH ||
-            context->dstFormat != dstFormat || context->flags != flags ||
-            context->param[0] != param[0] || context->param[1] != param[1])
-        {
-            sws_freeContext(context);
-            context = NULL;
-        }
+    if (context &&
+        (context->srcW      != srcW      ||
+         context->srcH      != srcH      ||
+         context->srcFormat != srcFormat ||
+         context->dstW      != dstW      ||
+         context->dstH      != dstH      ||
+         context->dstFormat != dstFormat ||
+         context->flags     != flags     ||
+         context->param[0]  != param[0]  ||
+         context->param[1]  != param[1])) {
+        sws_freeContext(context);
+        context = NULL;
     }
+
     if (!context) {
         return sws_getContext(srcW, srcH, srcFormat,
                               dstW, dstH, dstFormat, flags,