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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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