]> git.sesse.net Git - x264/blobdiff - filters/filters.c
arm: Implement x284_decimate_score15/16/64_neon
[x264] / filters / filters.c
index df75174a458c2021cab688530a80a2662c65a8fd..224f3683e17cb9f3cf101dc42307cfa6f61c2f3e 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * filters.c: common filter functions
  *****************************************************************************
- * Copyright (C) 2010 x264 project
+ * Copyright (C) 2010-2015 x264 project
  *
  * Authors: Diogo Franco <diogomfranco@gmail.com>
  *          Steven Walters <kemuri9@gmail.com>
@@ -27,7 +27,7 @@
 #include "filters.h"
 #define RETURN_IF_ERROR( cond, ... ) RETURN_IF_ERR( cond, "options", NULL, __VA_ARGS__ )
 
-char **x264_split_string( char *string, char *sep, uint32_t limit )
+char **x264_split_string( char *string, char *sep, int limit )
 {
     if( !string )
         return NULL;
@@ -38,13 +38,13 @@ char **x264_split_string( char *string, char *sep, uint32_t limit )
     if( sep_count == 0 )
     {
         if( string[0] == '\0' )
-            return calloc( 1, sizeof( char** ) );
-        char **ret = calloc( 2, sizeof( char** ) );
+            return calloc( 1, sizeof( char* ) );
+        char **ret = calloc( 2, sizeof( char* ) );
         ret[0] = strdup( string );
         return ret;
     }
 
-    char **split = calloc( ( limit > 0 ? limit : sep_count ) + 2, sizeof(char**) );
+    char **split = calloc( ( limit > 0 ? limit : sep_count ) + 2, sizeof(char*) );
     int i = 0;
     char *str = strdup( string );
     assert( str );
@@ -68,7 +68,10 @@ char **x264_split_string( char *string, char *sep, uint32_t limit )
             esc = NULL;
         }
         else
-            assert( ( split[i++] = strdup( tok ) ) );
+        {
+            split[i++] = strdup( tok );
+            assert( split[i-1] );
+        }
         tok = nexttok;
     } while ( tok );
     free( str );
@@ -101,7 +104,7 @@ char **x264_split_options( const char *opt_str, const char *options[] )
     while( options[options_count] != NULL )
         ++options_count;
 
-    char **opts = calloc( split_count * 2 + 2, sizeof( char ** ) );
+    char **opts = calloc( split_count * 2 + 2, sizeof( char * ) );
     char **arg = NULL;
     int opt = 0, found_named = 0, invalid = 0;
     for( int i = 0; split[i] != NULL; i++, invalid = 0 )