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

ffmpeg.c:2888:1: start of procedure opt_input_ts_scale()
2886. }
2887. 
2888. static void opt_input_ts_scale(const char *arg)
      ^
2889. {
2890.     unsigned int stream;

ffmpeg.c:2894:5: 
2892.     char *p;
2893. 
2894.     stream = strtol(arg, &p, 0);
          ^
2895.     if (*p)
2896.         p++;

ffmpeg.c:2895:9: Taking false branch
2893. 
2894.     stream = strtol(arg, &p, 0);
2895.     if (*p)
              ^
2896.         p++;
2897.     scale= strtod(p, &p);

ffmpeg.c:2897:5: 
2895.     if (*p)
2896.         p++;
2897.     scale= strtod(p, &p);
          ^
2898. 
2899.     if(stream >= MAX_STREAMS)

ffmpeg.c:2899:8: Taking true branch
2897.     scale= strtod(p, &p);
2898. 
2899.     if(stream >= MAX_STREAMS)
             ^
2900.         ffmpeg_exit(1);
2901. 

ffmpeg.c:2900:9: Skipping ffmpeg_exit(): empty list of specs
2898. 
2899.     if(stream >= MAX_STREAMS)
2900.         ffmpeg_exit(1);
              ^
2901. 
2902.     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:2902:5: 
2900.         ffmpeg_exit(1);
2901. 
2902.     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);
          ^
2903.     input_files_ts_scale[nb_input_files][stream]= scale;
2904. }

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 true 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:570:9: 
  568. {
  569.     if (new_size >= INT_MAX / elem_size) {
  570.         fprintf(stderr, "Array too big.\n");
               ^
  571.         ffmpeg_exit(1);
  572.     }

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

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:2903:5: 
2901. 
2902.     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);
2903.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
2904. }
2905. 
