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

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

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

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

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

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

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

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

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

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

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

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

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

ffmpeg.c:518:9: 
  516.     }
  517.     if (*size < new_size) {
  518.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  519.         if (!tmp) {
  520.             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:519:14: Taking true branch
  517.     if (*size < new_size) {
  518.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  519.         if (!tmp) {
                    ^
  520.             fprintf(stderr, "Could not alloc buffer.\n");
  521.             ffmpeg_exit(1);

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

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

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

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

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

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

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