avutil/cpu: check av_parse_cpu_caps() table during cpu-test
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 6 Aug 2014 12:05:03 +0000 (14:05 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 6 Aug 2014 12:27:45 +0000 (14:27 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/cpu.c

index 9c043ba..1cd0522 100644 (file)
@@ -350,6 +350,15 @@ int main(int argc, char **argv)
     int cpu_flags_eff;
     int cpu_count = av_cpu_count();
     char threads[5] = "auto";
+    int i;
+
+    for(i = 0; cpu_flag_tab[i].flag; i++) {
+        unsigned tmp = 0;
+        if (av_parse_cpu_caps(&tmp, cpu_flag_tab[i].name) < 0) {
+            fprintf(stderr, "Table missing %s\n", cpu_flag_tab[i].name);
+            return 4;
+        }
+    }
 
     if (cpu_flags_raw < 0)
         return 1;