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

cmdutils.c:115:1: start of procedure parse_options()
113. }
114. 
115. void parse_options(int argc, char **argv, const OptionDef *options,
     ^
116.                    void (* parse_arg_function)(const char*))
117. {

cmdutils.c:119:5: 
117. {
118.     const char *opt, *arg;
119.     int optindex, handleoptions=1;
         ^
120.     const OptionDef *po;
121. 

cmdutils.c:123:5: 
121. 
122.     /* parse options */
123.     optindex = 1;
         ^
124.     while (optindex < argc) {
125.         opt = argv[optindex++];

cmdutils.c:124:12: Loop condition is true. Entering loop body
122.     /* parse options */
123.     optindex = 1;
124.     while (optindex < argc) {
                ^
125.         opt = argv[optindex++];
126. 

cmdutils.c:125:9: 
123.     optindex = 1;
124.     while (optindex < argc) {
125.         opt = argv[optindex++];
             ^
126. 
127.         if (handleoptions && opt[0] == '-' && opt[1] != '\0') {

cmdutils.c:127:13: Taking true branch
125.         opt = argv[optindex++];
126. 
127.         if (handleoptions && opt[0] == '-' && opt[1] != '\0') {
                 ^
128.             if (opt[1] == '-' && opt[2] == '\0') {
129.                 handleoptions = 0;

cmdutils.c:127:30: Taking true branch
125.         opt = argv[optindex++];
126. 
127.         if (handleoptions && opt[0] == '-' && opt[1] != '\0') {
                                  ^
128.             if (opt[1] == '-' && opt[2] == '\0') {
129.                 handleoptions = 0;

cmdutils.c:127:47: Taking true branch
125.         opt = argv[optindex++];
126. 
127.         if (handleoptions && opt[0] == '-' && opt[1] != '\0') {
                                                   ^
128.             if (opt[1] == '-' && opt[2] == '\0') {
129.                 handleoptions = 0;

cmdutils.c:128:17: Taking false branch
126. 
127.         if (handleoptions && opt[0] == '-' && opt[1] != '\0') {
128.             if (opt[1] == '-' && opt[2] == '\0') {
                     ^
129.                 handleoptions = 0;
130.                 continue;

cmdutils.c:132:13: Skipping find_option(): empty list of specs
130.                 continue;
131.             }
132.             po= find_option(options, opt + 1);
                 ^
133.             if (!po->name)
134.                 po= find_option(options, "default");

cmdutils.c:133:18: Taking false branch
131.             }
132.             po= find_option(options, opt + 1);
133.             if (!po->name)
                      ^
134.                 po= find_option(options, "default");
135.             if (!po->name) {

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

cmdutils.c:140:13: 
138.                 exit(1);
139.             }
140.             arg = NULL;
                 ^
141.             if (po->flags & HAS_ARG) {
142.                 arg = argv[optindex++];

cmdutils.c:141:17: Taking false branch
139.             }
140.             arg = NULL;
141.             if (po->flags & HAS_ARG) {
                     ^
142.                 arg = argv[optindex++];
143.                 if (!arg) {

cmdutils.c:148:17: Taking false branch
146.                 }
147.             }
148.             if (po->flags & OPT_STRING) {
                     ^
149.                 char *str;
150.                 str = av_strdup(arg);

cmdutils.c:152:24: Taking false branch
150.                 str = av_strdup(arg);
151.                 *po->u.str_arg = str;
152.             } else if (po->flags & OPT_BOOL) {
                            ^
153.                 *po->u.int_arg = 1;
154.             } else if (po->flags & OPT_INT) {

cmdutils.c:154:24: Taking false branch
152.             } else if (po->flags & OPT_BOOL) {
153.                 *po->u.int_arg = 1;
154.             } else if (po->flags & OPT_INT) {
                            ^
155.                 *po->u.int_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT_MIN, INT_MAX);
156.             } else if (po->flags & OPT_INT64) {

cmdutils.c:156:24: Taking false branch
154.             } else if (po->flags & OPT_INT) {
155.                 *po->u.int_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT_MIN, INT_MAX);
156.             } else if (po->flags & OPT_INT64) {
                            ^
157.                 *po->u.int64_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT64_MIN, INT64_MAX);
158.             } else if (po->flags & OPT_FLOAT) {

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

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

cmdutils.c:55:1: start of procedure parse_number_or_die()
  53. const int this_year = 2009;
  54. 
  55. double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max)
      ^
  56. {
  57.     char *tail;

cmdutils.c:59:5: 
  57.     char *tail;
  58.     const char *error;
  59.     double d = strtod(numstr, &tail);
          ^
  60.     if (*tail)
  61.         error= "Expected number for %s but found: %s\n";

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

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

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

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

cmdutils.c:67:9: 
  65.         error= "Expected int64 for %s but found %s\n";
  66.     else
  67.         return d;
              ^
  68.     fprintf(stderr, error, context, numstr, min, max);
  69.     exit(1);

cmdutils.c:70:1: return from a call to parse_number_or_die
  68.     fprintf(stderr, error, context, numstr, min, max);
  69.     exit(1);
  70. }
      ^
  71. 
  72. int64_t parse_time_or_die(const char *context, const char *timestr, int is_duration)
