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

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

ffmpeg.c:3670:5: 
3668.     char idx_str[16];
3669. 
3670.     strncpy(idx_str, arg, sizeof(idx_str));
          ^
3671.     idx_str[sizeof(idx_str)-1] = '\0';
3672.     p = strchr(idx_str, ':');

ffmpeg.c:3671:5: 
3669. 
3670.     strncpy(idx_str, arg, sizeof(idx_str));
3671.     idx_str[sizeof(idx_str)-1] = '\0';
          ^
3672.     p = strchr(idx_str, ':');
3673.     if (!p) {

ffmpeg.c:3672:5: 
3670.     strncpy(idx_str, arg, sizeof(idx_str));
3671.     idx_str[sizeof(idx_str)-1] = '\0';
3672.     p = strchr(idx_str, ':');
          ^
3673.     if (!p) {
3674.         fprintf(stderr,

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

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

ffmpeg.c:3680:5: Skipping parse_number_or_die(): empty list of specs
3678.     }
3679.     *p++ = '\0';
3680.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
          ^
3681.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
3682.     streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);

ffmpeg.c:3681:5: 
3679.     *p++ = '\0';
3680.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3681.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
          ^
3682.     streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
3683.     return 0;

ffmpeg.c:575:1: start of procedure grow_array()
  573. 
  574. /* similar to ff_dynarray_add() and av_fast_realloc() */
  575. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  576. {
  577.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:577:9: Taking false branch
  575. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  576. {
  577.     if (new_size >= INT_MAX / elem_size) {
               ^
  578.         fprintf(stderr, "Array too big.\n");
  579.         ffmpeg_exit(1);

ffmpeg.c:581:9: Taking true branch
  579.         ffmpeg_exit(1);
  580.     }
  581.     if (*size < new_size) {
               ^
  582.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  583.         if (!tmp) {

ffmpeg.c:582:9: 
  580.     }
  581.     if (*size < new_size) {
  582.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  583.         if (!tmp) {
  584.             fprintf(stderr, "Could not alloc buffer.\n");

libavutil/mem.c:119:1: start of procedure av_realloc()
    117. }
    118. 
    119. void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)
         ^
    120. {
    121. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:126:8: Taking true branch
    124. 
    125.     /* let's disallow possible ambiguous cases */
    126.     if(size > (INT_MAX-16) )
                ^
    127.         return NULL;
    128. 

libavutil/mem.c:127:9: 
    125.     /* let's disallow possible ambiguous cases */
    126.     if(size > (INT_MAX-16) )
    127.         return NULL;
                 ^
    128. 
    129. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:137:1: return from a call to av_realloc
    135.     return realloc(ptr, size);
    136. #endif
    137. }
         ^
    138. 
    139. void av_free(void *ptr)

ffmpeg.c:583:14: Taking true branch
  581.     if (*size < new_size) {
  582.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  583.         if (!tmp) {
                    ^
  584.             fprintf(stderr, "Could not alloc buffer.\n");
  585.             ffmpeg_exit(1);

ffmpeg.c:584:13: 
  582.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  583.         if (!tmp) {
  584.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  585.             ffmpeg_exit(1);
  586.         }

ffmpeg.c:585:13: Skipping ffmpeg_exit(): empty list of specs
  583.         if (!tmp) {
  584.             fprintf(stderr, "Could not alloc buffer.\n");
  585.             ffmpeg_exit(1);
                   ^
  586.         }
  587.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:587:9: 
  585.             ffmpeg_exit(1);
  586.         }
  587.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  588.         *size = new_size;
  589.         return tmp;

ffmpeg.c:588:9: 
  586.         }
  587.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  588.         *size = new_size;
               ^
  589.         return tmp;
  590.     }

ffmpeg.c:589:9: 
  587.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  588.         *size = new_size;
  589.         return tmp;
               ^
  590.     }
  591.     return array;

ffmpeg.c:592:1: return from a call to grow_array
  590.     }
  591.     return array;
  592. }
       ^
  593. 
  594. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3682:5: Skipping parse_number_or_die(): empty list of specs
3680.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3681.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
3682.     streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
          ^
3683.     return 0;
3684. }
