]> git.sesse.net Git - mlt/blobdiff - src/modules/avformat/filter_avcolour_space.c
Make the arg to avcolor_space filter a pointer.
[mlt] / src / modules / avformat / filter_avcolour_space.c
index 44f47858674d2404c170aab663cd8a7337047dbf..3733733ec5aa748a8673e417e275e210cb254bbb 100644 (file)
@@ -324,13 +324,16 @@ mlt_filter filter_avcolour_space_init( void *arg )
        // Test to see if swscale accepts the arg as resolution
        if ( arg )
        {
-               int width = (int) arg;
-               struct SwsContext *context = sws_getContext( width, width, PIX_FMT_RGB32, 64, 64, PIX_FMT_RGB32, SWS_BILINEAR, NULL, NULL, NULL);
-               if ( context )
-                       sws_freeContext( context );
-               else
-                       return NULL;
-       }               
+               int *width = (int*) arg;
+               if ( *width > 0 )
+               {
+                       struct SwsContext *context = sws_getContext( *width, *width, PIX_FMT_RGB32, 64, 64, PIX_FMT_RGB32, SWS_BILINEAR, NULL, NULL, NULL);
+                       if ( context )
+                               sws_freeContext( context );
+                       else
+                               return NULL;
+               }
+       }
 #else
        return NULL;
 #endif