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

ffmpeg.c:3516:1: start of procedure opt_streamid()
3514. 
3515. /* arg format is "output-stream-index:streamid-value". */
3516. static int opt_streamid(const char *opt, const char *arg)
      ^
3517. {
3518.     int idx;

ffmpeg.c:3522:5: 
3520.     char idx_str[16];
3521. 
3522.     strncpy(idx_str, arg, sizeof(idx_str));
          ^
3523.     idx_str[sizeof(idx_str)-1] = '\0';
3524.     p = strchr(idx_str, ':');

ffmpeg.c:3523:5: 
3521. 
3522.     strncpy(idx_str, arg, sizeof(idx_str));
3523.     idx_str[sizeof(idx_str)-1] = '\0';
          ^
3524.     p = strchr(idx_str, ':');
3525.     if (!p) {

ffmpeg.c:3524:5: 
3522.     strncpy(idx_str, arg, sizeof(idx_str));
3523.     idx_str[sizeof(idx_str)-1] = '\0';
3524.     p = strchr(idx_str, ':');
          ^
3525.     if (!p) {
3526.         fprintf(stderr,

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

ffmpeg.c:3531:5: 
3529.         ffmpeg_exit(1);
3530.     }
3531.     *p++ = '\0';
          ^
3532.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3533.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);

ffmpeg.c:3532:5: Skipping parse_number_or_die(): empty list of specs
3530.     }
3531.     *p++ = '\0';
3532.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
          ^
3533.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
3534.     streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);

ffmpeg.c:3533:5: 
3531.     *p++ = '\0';
3532.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3533.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
          ^
3534.     streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
3535.     return 0;

ffmpeg.c:567:1: start of procedure grow_array()
  565. 
  566. /* similar to ff_dynarray_add() and av_fast_realloc() */
  567. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  568. {
  569.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:569:9: Taking false branch
  567. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  568. {
  569.     if (new_size >= INT_MAX / elem_size) {
               ^
  570.         fprintf(stderr, "Array too big.\n");
  571.         ffmpeg_exit(1);

ffmpeg.c:573:9: Taking true branch
  571.         ffmpeg_exit(1);
  572.     }
  573.     if (*size < new_size) {
               ^
  574.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  575.         if (!tmp) {

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

ffmpeg.c:576:13: 
  574.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  575.         if (!tmp) {
  576.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  577.             ffmpeg_exit(1);
  578.         }

ffmpeg.c:577:13: Skipping ffmpeg_exit(): empty list of specs
  575.         if (!tmp) {
  576.             fprintf(stderr, "Could not alloc buffer.\n");
  577.             ffmpeg_exit(1);
                   ^
  578.         }
  579.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:579:9: 
  577.             ffmpeg_exit(1);
  578.         }
  579.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  580.         *size = new_size;
  581.         return tmp;

ffmpeg.c:580:9: 
  578.         }
  579.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  580.         *size = new_size;
               ^
  581.         return tmp;
  582.     }

ffmpeg.c:581:9: 
  579.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  580.         *size = new_size;
  581.         return tmp;
               ^
  582.     }
  583.     return array;

ffmpeg.c:584:1: return from a call to grow_array
  582.     }
  583.     return array;
  584. }
       ^
  585. 
  586. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3534:5: Skipping parse_number_or_die(): empty list of specs
3532.     idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3533.     streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
3534.     streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
          ^
3535.     return 0;
3536. }
