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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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