ffmpeg.c:2980: error: Null Dereference
  pointer `input_files_ts_scale[nb_input_files]` last assigned on line 2979 could be null and is dereferenced at line 2980, column 5.

ffmpeg.c:2965:1: start of procedure opt_input_ts_scale()
2963. }
2964. 
2965. static void opt_input_ts_scale(const char *arg)
      ^
2966. {
2967.     unsigned int stream;

ffmpeg.c:2971:5: 
2969.     char *p;
2970. 
2971.     stream = strtol(arg, &p, 0);
          ^
2972.     if (*p)
2973.         p++;

ffmpeg.c:2972:9: Taking true branch
2970. 
2971.     stream = strtol(arg, &p, 0);
2972.     if (*p)
              ^
2973.         p++;
2974.     scale= strtod(p, &p);

ffmpeg.c:2973:9: 
2971.     stream = strtol(arg, &p, 0);
2972.     if (*p)
2973.         p++;
              ^
2974.     scale= strtod(p, &p);
2975. 

ffmpeg.c:2974:5: 
2972.     if (*p)
2973.         p++;
2974.     scale= strtod(p, &p);
          ^
2975. 
2976.     if(stream >= MAX_STREAMS)

ffmpeg.c:2976:8: Taking true branch
2974.     scale= strtod(p, &p);
2975. 
2976.     if(stream >= MAX_STREAMS)
             ^
2977.         ffmpeg_exit(1);
2978. 

ffmpeg.c:2977:9: Skipping ffmpeg_exit(): empty list of specs
2975. 
2976.     if(stream >= MAX_STREAMS)
2977.         ffmpeg_exit(1);
              ^
2978. 
2979.     input_files_ts_scale[nb_input_files] = grow_array(input_files_ts_scale[nb_input_files], sizeof(*input_files_ts_scale[nb_input_files]), &nb_input_files_ts_scale[nb_input_files], stream + 1);

ffmpeg.c:2979:5: 
2977.         ffmpeg_exit(1);
2978. 
2979.     input_files_ts_scale[nb_input_files] = grow_array(input_files_ts_scale[nb_input_files], sizeof(*input_files_ts_scale[nb_input_files]), &nb_input_files_ts_scale[nb_input_files], stream + 1);
          ^
2980.     input_files_ts_scale[nb_input_files][stream]= scale;
2981. }

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

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

ffmpeg.c:573:9: 
  571. {
  572.     if (new_size >= INT_MAX / elem_size) {
  573.         fprintf(stderr, "Array too big.\n");
               ^
  574.         ffmpeg_exit(1);
  575.     }

ffmpeg.c:574:9: Skipping ffmpeg_exit(): empty list of specs
  572.     if (new_size >= INT_MAX / elem_size) {
  573.         fprintf(stderr, "Array too big.\n");
  574.         ffmpeg_exit(1);
               ^
  575.     }
  576.     if (*size < new_size) {

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

ffmpeg.c:577:9: 
  575.     }
  576.     if (*size < new_size) {
  577.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  578.         if (!tmp) {
  579.             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 false branch
    124. 
    125.     /* let's disallow possible ambiguous cases */
    126.     if(size > (INT_MAX-16) )
                ^
    127.         return NULL;
    128. 

libavutil/mem.c:135:5: 
    133.     return (char*)realloc((char*)ptr - diff, size + diff) + diff;
    134. #else
    135.     return realloc(ptr, size);
             ^
    136. #endif
    137. }

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

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

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

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

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

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

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

ffmpeg.c:2980:5: 
2978. 
2979.     input_files_ts_scale[nb_input_files] = grow_array(input_files_ts_scale[nb_input_files], sizeof(*input_files_ts_scale[nb_input_files]), &nb_input_files_ts_scale[nb_input_files], stream + 1);
2980.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
2981. }
2982. 
