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

ffmpeg.c:3684:1: start of procedure opt_streamid()
3682. 
3683. /* arg format is "output-stream-index:streamid-value". */
3684. static int opt_streamid(const char *opt, const char *arg)
      ^
3685. {
3686.     int idx;

ffmpeg.c:3690:5: 
3688.     char idx_str[16];
3689. 
3690.     strncpy(idx_str, arg, sizeof(idx_str));
          ^
3691.     idx_str[sizeof(idx_str)-1] = '\0';
3692.     p = strchr(idx_str, ':');

ffmpeg.c:3691:5: 
3689. 
3690.     strncpy(idx_str, arg, sizeof(idx_str));
3691.     idx_str[sizeof(idx_str)-1] = '\0';
          ^
3692.     p = strchr(idx_str, ':');
3693.     if (!p) {

ffmpeg.c:3692:5: 
3690.     strncpy(idx_str, arg, sizeof(idx_str));
3691.     idx_str[sizeof(idx_str)-1] = '\0';
3692.     p = strchr(idx_str, ':');
          ^
3693.     if (!p) {
3694.         fprintf(stderr,

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

ffmpeg.c:3699:5: 
3697.         ffmpeg_exit(1);
3698.     }
3699.     *p++ = '\0';
          ^
3700.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3701.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);

ffmpeg.c:3700:5: Skipping parse_number_or_die(): empty list of specs
3698.     }
3699.     *p++ = '\0';
3700.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
          ^
3701.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
3702.     streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);

ffmpeg.c:3701:5: 
3699.     *p++ = '\0';
3700.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3701.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
          ^
3702.     streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
3703.     return 0;

ffmpeg.c:662:1: start of procedure grow_array()
  660. 
  661. /* similar to ff_dynarray_add() and av_fast_realloc() */
  662. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  663. {
  664.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:664:9: Taking false branch
  662. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  663. {
  664.     if (new_size >= INT_MAX / elem_size) {
               ^
  665.         fprintf(stderr, "Array too big.\n");
  666.         ffmpeg_exit(1);

ffmpeg.c:668:9: Taking true branch
  666.         ffmpeg_exit(1);
  667.     }
  668.     if (*size < new_size) {
               ^
  669.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  670.         if (!tmp) {

ffmpeg.c:669:9: 
  667.     }
  668.     if (*size < new_size) {
  669.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  670.         if (!tmp) {
  671.             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, unsigned int 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:670:14: Taking true branch
  668.     if (*size < new_size) {
  669.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  670.         if (!tmp) {
                    ^
  671.             fprintf(stderr, "Could not alloc buffer.\n");
  672.             ffmpeg_exit(1);

ffmpeg.c:671:13: 
  669.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  670.         if (!tmp) {
  671.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  672.             ffmpeg_exit(1);
  673.         }

ffmpeg.c:672:13: Skipping ffmpeg_exit(): empty list of specs
  670.         if (!tmp) {
  671.             fprintf(stderr, "Could not alloc buffer.\n");
  672.             ffmpeg_exit(1);
                   ^
  673.         }
  674.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:674:9: 
  672.             ffmpeg_exit(1);
  673.         }
  674.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  675.         *size = new_size;
  676.         return tmp;

ffmpeg.c:675:9: 
  673.         }
  674.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  675.         *size = new_size;
               ^
  676.         return tmp;
  677.     }

ffmpeg.c:676:9: 
  674.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  675.         *size = new_size;
  676.         return tmp;
               ^
  677.     }
  678.     return array;

ffmpeg.c:679:1: return from a call to grow_array
  677.     }
  678.     return array;
  679. }
       ^
  680. 
  681. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3702:5: Skipping parse_number_or_die(): empty list of specs
3700.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3701.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
3702.     streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
          ^
3703.     return 0;
3704. }
