cmdutils.c:146: error: Null Dereference
  pointer `arg` last assigned on line 127 could be null and is dereferenced by call to `parse_number_or_die()` at line 146, column 36.

cmdutils.c:102:1: start of procedure parse_options()
100. }
101. 
102. void parse_options(int argc, char **argv, const OptionDef *options,
     ^
103.                    void (* parse_arg_function)(const char*))
104. {

cmdutils.c:106:5: 
104. {
105.     const char *opt, *arg;
106.     int optindex, handleoptions=1;
         ^
107.     const OptionDef *po;
108. 

cmdutils.c:110:5: 
108. 
109.     /* parse options */
110.     optindex = 1;
         ^
111.     while (optindex < argc) {
112.         opt = argv[optindex++];

cmdutils.c:111:12: Loop condition is true. Entering loop body
109.     /* parse options */
110.     optindex = 1;
111.     while (optindex < argc) {
                ^
112.         opt = argv[optindex++];
113. 

cmdutils.c:112:9: 
110.     optindex = 1;
111.     while (optindex < argc) {
112.         opt = argv[optindex++];
             ^
113. 
114.         if (handleoptions && opt[0] == '-' && opt[1] != '\0') {

cmdutils.c:114:13: Taking true branch
112.         opt = argv[optindex++];
113. 
114.         if (handleoptions && opt[0] == '-' && opt[1] != '\0') {
                 ^
115.           if (opt[1] == '-' && opt[2] == '\0') {
116.             handleoptions = 0;

cmdutils.c:114:30: Taking true branch
112.         opt = argv[optindex++];
113. 
114.         if (handleoptions && opt[0] == '-' && opt[1] != '\0') {
                                  ^
115.           if (opt[1] == '-' && opt[2] == '\0') {
116.             handleoptions = 0;

cmdutils.c:114:47: Taking true branch
112.         opt = argv[optindex++];
113. 
114.         if (handleoptions && opt[0] == '-' && opt[1] != '\0') {
                                                   ^
115.           if (opt[1] == '-' && opt[2] == '\0') {
116.             handleoptions = 0;

cmdutils.c:115:15: Taking false branch
113. 
114.         if (handleoptions && opt[0] == '-' && opt[1] != '\0') {
115.           if (opt[1] == '-' && opt[2] == '\0') {
                   ^
116.             handleoptions = 0;
117.             continue;

cmdutils.c:119:13: Skipping find_option(): empty list of specs
117.             continue;
118.           }
119.             po= find_option(options, opt + 1);
                 ^
120.             if (!po->name)
121.                 po= find_option(options, "default");

cmdutils.c:120:18: Taking false branch
118.           }
119.             po= find_option(options, opt + 1);
120.             if (!po->name)
                      ^
121.                 po= find_option(options, "default");
122.             if (!po->name) {

cmdutils.c:122:18: Taking false branch
120.             if (!po->name)
121.                 po= find_option(options, "default");
122.             if (!po->name) {
                      ^
123. unknown_opt:
124.                 fprintf(stderr, "%s: unrecognized option '%s'\n", argv[0], opt);

cmdutils.c:127:13: 
125.                 exit(1);
126.             }
127.             arg = NULL;
                 ^
128.             if (po->flags & HAS_ARG) {
129.                 arg = argv[optindex++];

cmdutils.c:128:17: Taking false branch
126.             }
127.             arg = NULL;
128.             if (po->flags & HAS_ARG) {
                     ^
129.                 arg = argv[optindex++];
130.                 if (!arg) {

cmdutils.c:135:17: Taking false branch
133.                 }
134.             }
135.             if (po->flags & OPT_STRING) {
                     ^
136.                 char *str;
137.                 str = av_strdup(arg);

cmdutils.c:139:24: Taking false branch
137.                 str = av_strdup(arg);
138.                 *po->u.str_arg = str;
139.             } else if (po->flags & OPT_BOOL) {
                            ^
140.                 *po->u.int_arg = 1;
141.             } else if (po->flags & OPT_INT) {

cmdutils.c:141:24: Taking false branch
139.             } else if (po->flags & OPT_BOOL) {
140.                 *po->u.int_arg = 1;
141.             } else if (po->flags & OPT_INT) {
                            ^
142.                 *po->u.int_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT_MIN, INT_MAX);
143.             } else if (po->flags & OPT_INT64) {

cmdutils.c:143:24: Taking false branch
141.             } else if (po->flags & OPT_INT) {
142.                 *po->u.int_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT_MIN, INT_MAX);
143.             } else if (po->flags & OPT_INT64) {
                            ^
144.                 *po->u.int64_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT64_MIN, INT64_MAX);
145.             } else if (po->flags & OPT_FLOAT) {

cmdutils.c:145:24: Taking true branch
143.             } else if (po->flags & OPT_INT64) {
144.                 *po->u.int64_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT64_MIN, INT64_MAX);
145.             } else if (po->flags & OPT_FLOAT) {
                            ^
146.                 *po->u.float_arg = parse_number_or_die(opt+1, arg, OPT_FLOAT, -1.0/0.0, 1.0/0.0);
147.             } else if (po->flags & OPT_FUNC2) {

cmdutils.c:146:17: 
144.                 *po->u.int64_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT64_MIN, INT64_MAX);
145.             } else if (po->flags & OPT_FLOAT) {
146.                 *po->u.float_arg = parse_number_or_die(opt+1, arg, OPT_FLOAT, -1.0/0.0, 1.0/0.0);
                     ^
147.             } else if (po->flags & OPT_FUNC2) {
148.                 if(po->u.func2_arg(opt+1, arg)<0)

cmdutils.c:42:1: start of procedure parse_number_or_die()
  40. 
  41. 
  42. double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max)
      ^
  43. {
  44.     char *tail;

cmdutils.c:46:5: 
  44.     char *tail;
  45.     const char *error;
  46.     double d = strtod(numstr, &tail);
          ^
  47.     if (*tail)
  48.         error= "Expected number for %s but found: %s\n";

cmdutils.c:47:9: Taking false branch
  45.     const char *error;
  46.     double d = strtod(numstr, &tail);
  47.     if (*tail)
              ^
  48.         error= "Expected number for %s but found: %s\n";
  49.     else if (d < min || d > max)

cmdutils.c:49:14: Taking false branch
  47.     if (*tail)
  48.         error= "Expected number for %s but found: %s\n";
  49.     else if (d < min || d > max)
                   ^
  50.         error= "The value for %s was %s which is not within %f - %f\n";
  51.     else if(type == OPT_INT64 && (int64_t)d != d)

cmdutils.c:49:25: Taking false branch
  47.     if (*tail)
  48.         error= "Expected number for %s but found: %s\n";
  49.     else if (d < min || d > max)
                              ^
  50.         error= "The value for %s was %s which is not within %f - %f\n";
  51.     else if(type == OPT_INT64 && (int64_t)d != d)

cmdutils.c:51:13: Taking false branch
  49.     else if (d < min || d > max)
  50.         error= "The value for %s was %s which is not within %f - %f\n";
  51.     else if(type == OPT_INT64 && (int64_t)d != d)
                  ^
  52.         error= "Expected int64 for %s but found %s\n";
  53.     else

cmdutils.c:54:9: 
  52.         error= "Expected int64 for %s but found %s\n";
  53.     else
  54.         return d;
              ^
  55.     fprintf(stderr, error, context, numstr, min, max);
  56.     exit(1);

cmdutils.c:57:1: return from a call to parse_number_or_die
  55.     fprintf(stderr, error, context, numstr, min, max);
  56.     exit(1);
  57. }
      ^
  58. 
  59. int64_t parse_time_or_die(const char *context, const char *timestr, int is_duration)
