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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

cmdutils.c:57:1: start of procedure parse_number_or_die()
  55. struct SwsContext *sws_opts;
  56. 
  57. double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max)
      ^
  58. {
  59.     char *tail;

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

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

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

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

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

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

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