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

ffmpeg.c:3634:1: start of procedure opt_streamid()
3632. 
3633. /* arg format is "output-stream-index:streamid-value". */
3634. static int opt_streamid(const char *opt, const char *arg)
      ^
3635. {
3636.     int idx;

ffmpeg.c:3640:5: 
3638.     char idx_str[16];
3639. 
3640.     strncpy(idx_str, arg, sizeof(idx_str));
          ^
3641.     idx_str[sizeof(idx_str)-1] = '\0';
3642.     p = strchr(idx_str, ':');

ffmpeg.c:3641:5: 
3639. 
3640.     strncpy(idx_str, arg, sizeof(idx_str));
3641.     idx_str[sizeof(idx_str)-1] = '\0';
          ^
3642.     p = strchr(idx_str, ':');
3643.     if (!p) {

ffmpeg.c:3642:5: 
3640.     strncpy(idx_str, arg, sizeof(idx_str));
3641.     idx_str[sizeof(idx_str)-1] = '\0';
3642.     p = strchr(idx_str, ':');
          ^
3643.     if (!p) {
3644.         fprintf(stderr,

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

ffmpeg.c:3649:5: 
3647.         ffmpeg_exit(1);
3648.     }
3649.     *p++ = '\0';
          ^
3650.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3651.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);

ffmpeg.c:3650:5: Skipping parse_number_or_die(): empty list of specs
3648.     }
3649.     *p++ = '\0';
3650.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
          ^
3651.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
3652.     streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);

ffmpeg.c:3651:5: 
3649.     *p++ = '\0';
3650.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3651.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
          ^
3652.     streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
3653.     return 0;

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

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

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

ffmpeg.c:579:9: 
  577.     }
  578.     if (*size < new_size) {
  579.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  580.         if (!tmp) {
  581.             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:580:14: Taking true branch
  578.     if (*size < new_size) {
  579.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  580.         if (!tmp) {
                    ^
  581.             fprintf(stderr, "Could not alloc buffer.\n");
  582.             ffmpeg_exit(1);

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

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

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

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

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

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

ffmpeg.c:3652:5: Skipping parse_number_or_die(): empty list of specs
3650.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3651.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
3652.     streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
          ^
3653.     return 0;
3654. }
