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

ffmpeg.c:3692:1: start of procedure opt_streamid()
3690. 
3691. /* arg format is "output-stream-index:streamid-value". */
3692. static int opt_streamid(const char *opt, const char *arg)
      ^
3693. {
3694.     int idx;

ffmpeg.c:3698:5: 
3696.     char idx_str[16];
3697. 
3698.     strncpy(idx_str, arg, sizeof(idx_str));
          ^
3699.     idx_str[sizeof(idx_str)-1] = '\0';
3700.     p = strchr(idx_str, ':');

ffmpeg.c:3699:5: 
3697. 
3698.     strncpy(idx_str, arg, sizeof(idx_str));
3699.     idx_str[sizeof(idx_str)-1] = '\0';
          ^
3700.     p = strchr(idx_str, ':');
3701.     if (!p) {

ffmpeg.c:3700:5: 
3698.     strncpy(idx_str, arg, sizeof(idx_str));
3699.     idx_str[sizeof(idx_str)-1] = '\0';
3700.     p = strchr(idx_str, ':');
          ^
3701.     if (!p) {
3702.         fprintf(stderr,

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

ffmpeg.c:3707:5: 
3705.         ffmpeg_exit(1);
3706.     }
3707.     *p++ = '\0';
          ^
3708.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3709.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);

ffmpeg.c:3708:5: Skipping parse_number_or_die(): empty list of specs
3706.     }
3707.     *p++ = '\0';
3708.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
          ^
3709.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
3710.     streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);

ffmpeg.c:3709:5: 
3707.     *p++ = '\0';
3708.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3709.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
          ^
3710.     streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
3711.     return 0;

ffmpeg.c:524:1: start of procedure grow_array()
  522. 
  523. /* similar to ff_dynarray_add() and av_fast_realloc() */
  524. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  525. {
  526.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:526:9: Taking false branch
  524. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  525. {
  526.     if (new_size >= INT_MAX / elem_size) {
               ^
  527.         fprintf(stderr, "Array too big.\n");
  528.         ffmpeg_exit(1);

ffmpeg.c:530:9: Taking true branch
  528.         ffmpeg_exit(1);
  529.     }
  530.     if (*size < new_size) {
               ^
  531.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  532.         if (!tmp) {

ffmpeg.c:531:9: 
  529.     }
  530.     if (*size < new_size) {
  531.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  532.         if (!tmp) {
  533.             fprintf(stderr, "Could not alloc buffer.\n");

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

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

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

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

ffmpeg.c:532:14: Taking true branch
  530.     if (*size < new_size) {
  531.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  532.         if (!tmp) {
                    ^
  533.             fprintf(stderr, "Could not alloc buffer.\n");
  534.             ffmpeg_exit(1);

ffmpeg.c:533:13: 
  531.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  532.         if (!tmp) {
  533.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  534.             ffmpeg_exit(1);
  535.         }

ffmpeg.c:534:13: Skipping ffmpeg_exit(): empty list of specs
  532.         if (!tmp) {
  533.             fprintf(stderr, "Could not alloc buffer.\n");
  534.             ffmpeg_exit(1);
                   ^
  535.         }
  536.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:536:9: 
  534.             ffmpeg_exit(1);
  535.         }
  536.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  537.         *size = new_size;
  538.         return tmp;

ffmpeg.c:537:9: 
  535.         }
  536.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  537.         *size = new_size;
               ^
  538.         return tmp;
  539.     }

ffmpeg.c:538:9: 
  536.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  537.         *size = new_size;
  538.         return tmp;
               ^
  539.     }
  540.     return array;

ffmpeg.c:541:1: return from a call to grow_array
  539.     }
  540.     return array;
  541. }
       ^
  542. 
  543. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3710:5: Skipping parse_number_or_die(): empty list of specs
3708.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3709.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
3710.     streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
          ^
3711.     return 0;
3712. }
