ffmpeg.c:3675: error: Null Dereference
  pointer `p` last assigned on line 3675 could be null and is dereferenced at line 3675, column 5.

ffmpeg.c:3660:1: start of procedure opt_streamid()
3658. 
3659. /* arg format is "output-stream-index:streamid-value". */
3660. static int opt_streamid(const char *opt, const char *arg)
      ^
3661. {
3662.     int idx;

ffmpeg.c:3666:5: 
3664.     char idx_str[16];
3665. 
3666.     strncpy(idx_str, arg, sizeof(idx_str));
          ^
3667.     idx_str[sizeof(idx_str)-1] = '\0';
3668.     p = strchr(idx_str, ':');

ffmpeg.c:3667:5: 
3665. 
3666.     strncpy(idx_str, arg, sizeof(idx_str));
3667.     idx_str[sizeof(idx_str)-1] = '\0';
          ^
3668.     p = strchr(idx_str, ':');
3669.     if (!p) {

ffmpeg.c:3668:5: 
3666.     strncpy(idx_str, arg, sizeof(idx_str));
3667.     idx_str[sizeof(idx_str)-1] = '\0';
3668.     p = strchr(idx_str, ':');
          ^
3669.     if (!p) {
3670.         fprintf(stderr,

ffmpeg.c:3669:10: Taking true branch
3667.     idx_str[sizeof(idx_str)-1] = '\0';
3668.     p = strchr(idx_str, ':');
3669.     if (!p) {
               ^
3670.         fprintf(stderr,
3671.                 "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",

ffmpeg.c:3670:9: 
3668.     p = strchr(idx_str, ':');
3669.     if (!p) {
3670.         fprintf(stderr,
              ^
3671.                 "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
3672.                 arg, opt);

ffmpeg.c:3673:9: Skipping ffmpeg_exit(): empty list of specs
3671.                 "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
3672.                 arg, opt);
3673.         ffmpeg_exit(1);
              ^
3674.     }
3675.     *p++ = '\0';

ffmpeg.c:3675:5: 
3673.         ffmpeg_exit(1);
3674.     }
3675.     *p++ = '\0';
          ^
3676.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3677.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);

static int opt_streamid(const char *opt, const char *arg)
{
    int idx;
    char *p;
    char idx_str[16];
    strncpy(idx_str, arg, sizeof(idx_str));
    idx_str[sizeof(idx_str)-1] = '\0';
    p = strchr(idx_str, ':');
    if (!p) {
        fprintf(stderr,
                "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
                arg, opt);
        ffmpeg_exit(1);
    }
    *p++ = '\0';
    idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
    streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
    streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
    return 0;
}
['static int opt_streamid(const char *opt, const char *arg)\n{\n    int idx;\n    char *p;\n    char idx_str[16];\n    strncpy(idx_str, arg, sizeof(idx_str));\n    idx_str[sizeof(idx_str)-1] = \'\\0\';\n    p = strchr(idx_str, \':\');\n    if (!p) {\n        fprintf(stderr,\n                "Invalid value \'%s\' for option \'%s\', required syntax is \'index:value\'\\n",\n                arg, opt);\n        ffmpeg_exit(1);\n    }\n    *p++ = \'\\0\';\n    idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);\n    streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);\n    streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);\n    return 0;\n}']