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

ffmpeg.c:3071:1: start of procedure opt_input_ts_scale()
3069. }
3070. 
3071. static void opt_input_ts_scale(const char *arg)
      ^
3072. {
3073.     unsigned int stream;

ffmpeg.c:3077:5: 
3075.     char *p;
3076. 
3077.     stream = strtol(arg, &p, 0);
          ^
3078.     if (*p)
3079.         p++;

ffmpeg.c:3078:9: Taking true branch
3076. 
3077.     stream = strtol(arg, &p, 0);
3078.     if (*p)
              ^
3079.         p++;
3080.     scale= strtod(p, &p);

ffmpeg.c:3079:9: 
3077.     stream = strtol(arg, &p, 0);
3078.     if (*p)
3079.         p++;
              ^
3080.     scale= strtod(p, &p);
3081. 

ffmpeg.c:3080:5: 
3078.     if (*p)
3079.         p++;
3080.     scale= strtod(p, &p);
          ^
3081. 
3082.     if(stream >= MAX_STREAMS)

ffmpeg.c:3082:8: Taking true branch
3080.     scale= strtod(p, &p);
3081. 
3082.     if(stream >= MAX_STREAMS)
             ^
3083.         ffmpeg_exit(1);
3084. 

ffmpeg.c:3083:9: Skipping ffmpeg_exit(): empty list of specs
3081. 
3082.     if(stream >= MAX_STREAMS)
3083.         ffmpeg_exit(1);
              ^
3084. 
3085.     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:3085:5: 
3083.         ffmpeg_exit(1);
3084. 
3085.     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);
          ^
3086.     input_files_ts_scale[nb_input_files][stream]= scale;
3087. }

ffmpeg.c:512:1: start of procedure grow_array()
  510. 
  511. /* similar to ff_dynarray_add() and av_fast_realloc() */
  512. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  513. {
  514.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:514:9: Taking true branch
  512. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  513. {
  514.     if (new_size >= INT_MAX / elem_size) {
               ^
  515.         fprintf(stderr, "Array too big.\n");
  516.         ffmpeg_exit(1);

ffmpeg.c:515:9: 
  513. {
  514.     if (new_size >= INT_MAX / elem_size) {
  515.         fprintf(stderr, "Array too big.\n");
               ^
  516.         ffmpeg_exit(1);
  517.     }

ffmpeg.c:516:9: Skipping ffmpeg_exit(): empty list of specs
  514.     if (new_size >= INT_MAX / elem_size) {
  515.         fprintf(stderr, "Array too big.\n");
  516.         ffmpeg_exit(1);
               ^
  517.     }
  518.     if (*size < new_size) {

ffmpeg.c:518:9: Taking true branch
  516.         ffmpeg_exit(1);
  517.     }
  518.     if (*size < new_size) {
               ^
  519.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  520.         if (!tmp) {

ffmpeg.c:519:9: 
  517.     }
  518.     if (*size < new_size) {
  519.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  520.         if (!tmp) {
  521.             fprintf(stderr, "Could not alloc buffer.\n");

libavutil/mem.c:117:1: start of procedure av_realloc()
    115. }
    116. 
    117. void *av_realloc(void *ptr, size_t size)
         ^
    118. {
    119. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:124:8: Taking false branch
    122. 
    123.     /* let's disallow possible ambiguous cases */
    124.     if(size > (INT_MAX-16) )
                ^
    125.         return NULL;
    126. 

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

libavutil/mem.c:135:1: return from a call to av_realloc
    133.     return realloc(ptr, size);
    134. #endif
    135. }
         ^
    136. 
    137. void av_free(void *ptr)

ffmpeg.c:520:14: Taking true branch
  518.     if (*size < new_size) {
  519.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  520.         if (!tmp) {
                    ^
  521.             fprintf(stderr, "Could not alloc buffer.\n");
  522.             ffmpeg_exit(1);

ffmpeg.c:521:13: 
  519.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  520.         if (!tmp) {
  521.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  522.             ffmpeg_exit(1);
  523.         }

ffmpeg.c:522:13: Skipping ffmpeg_exit(): empty list of specs
  520.         if (!tmp) {
  521.             fprintf(stderr, "Could not alloc buffer.\n");
  522.             ffmpeg_exit(1);
                   ^
  523.         }
  524.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:524:9: 
  522.             ffmpeg_exit(1);
  523.         }
  524.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  525.         *size = new_size;
  526.         return tmp;

ffmpeg.c:525:9: 
  523.         }
  524.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  525.         *size = new_size;
               ^
  526.         return tmp;
  527.     }

ffmpeg.c:526:9: 
  524.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  525.         *size = new_size;
  526.         return tmp;
               ^
  527.     }
  528.     return array;

ffmpeg.c:529:1: return from a call to grow_array
  527.     }
  528.     return array;
  529. }
       ^
  530. 
  531. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3086:5: 
3084. 
3085.     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);
3086.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
3087. }
3088. 
