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

ffmpeg.c:2902:1: start of procedure opt_input_ts_scale()
2900. }
2901. 
2902. static void opt_input_ts_scale(const char *arg)
      ^
2903. {
2904.     unsigned int stream;

ffmpeg.c:2908:5: 
2906.     char *p;
2907. 
2908.     stream = strtol(arg, &p, 0);
          ^
2909.     if (*p)
2910.         p++;

ffmpeg.c:2909:9: Taking true branch
2907. 
2908.     stream = strtol(arg, &p, 0);
2909.     if (*p)
              ^
2910.         p++;
2911.     scale= strtod(p, &p);

ffmpeg.c:2910:9: 
2908.     stream = strtol(arg, &p, 0);
2909.     if (*p)
2910.         p++;
              ^
2911.     scale= strtod(p, &p);
2912. 

ffmpeg.c:2911:5: 
2909.     if (*p)
2910.         p++;
2911.     scale= strtod(p, &p);
          ^
2912. 
2913.     if(stream >= MAX_STREAMS)

ffmpeg.c:2913:8: Taking true branch
2911.     scale= strtod(p, &p);
2912. 
2913.     if(stream >= MAX_STREAMS)
             ^
2914.         ffmpeg_exit(1);
2915. 

ffmpeg.c:2914:9: Skipping ffmpeg_exit(): empty list of specs
2912. 
2913.     if(stream >= MAX_STREAMS)
2914.         ffmpeg_exit(1);
              ^
2915. 
2916.     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:2916:5: 
2914.         ffmpeg_exit(1);
2915. 
2916.     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);
          ^
2917.     input_files_ts_scale[nb_input_files][stream]= scale;
2918. }

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

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

ffmpeg.c:569:9: 
  567. {
  568.     if (new_size >= INT_MAX / elem_size) {
  569.         fprintf(stderr, "Array too big.\n");
               ^
  570.         ffmpeg_exit(1);
  571.     }

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

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

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

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

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

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

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

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

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

ffmpeg.c:2917:5: 
2915. 
2916.     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);
2917.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
2918. }
2919. 
