gst-validate: Avoid overreading array
authorEdward Hervey <bilboed@bilboed.com>
Tue, 17 May 2016 08:03:26 +0000 (10:03 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Thu, 19 May 2016 10:07:57 +0000 (12:07 +0200)
If we offset the argv table as argument, we need to decrement the number
of items in the array (argc) when iterating it

validate/tools/gst-validate.c

index 415ab9cb8d112cdfe7f5794915843d3c3d3dcc7e..e77f822e26de9f03430fd350dc63e41009c9b8f3 100644 (file)
@@ -564,7 +564,7 @@ main (int argc, gchar ** argv)
       g_unix_signal_add (SIGINT, (GSourceFunc) intr_handler, pipeline);
 #endif
 
-  if (_is_playbin_pipeline (argc, argv + 1)) {
+  if (_is_playbin_pipeline (argc - 1, argv + 1)) {
     _register_playbin_actions ();
   }