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

ffmpeg.c:3083:1: start of procedure opt_input_ts_scale()
3081. }
3082. 
3083. static int opt_input_ts_scale(const char *opt, const char *arg)
      ^
3084. {
3085.     unsigned int stream;

ffmpeg.c:3089:5: 
3087.     char *p;
3088. 
3089.     stream = strtol(arg, &p, 0);
          ^
3090.     if (*p)
3091.         p++;

ffmpeg.c:3090:9: Taking false branch
3088. 
3089.     stream = strtol(arg, &p, 0);
3090.     if (*p)
              ^
3091.         p++;
3092.     scale= strtod(p, &p);

ffmpeg.c:3092:5: 
3090.     if (*p)
3091.         p++;
3092.     scale= strtod(p, &p);
          ^
3093. 
3094.     if(stream >= MAX_STREAMS)

ffmpeg.c:3094:8: Taking true branch
3092.     scale= strtod(p, &p);
3093. 
3094.     if(stream >= MAX_STREAMS)
             ^
3095.         ffmpeg_exit(1);
3096. 

ffmpeg.c:3095:9: Skipping ffmpeg_exit(): empty list of specs
3093. 
3094.     if(stream >= MAX_STREAMS)
3095.         ffmpeg_exit(1);
              ^
3096. 
3097.     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:3097:5: 
3095.         ffmpeg_exit(1);
3096. 
3097.     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);
          ^
3098.     input_files_ts_scale[nb_input_files][stream]= scale;
3099.     return 0;

ffmpeg.c:525:1: start of procedure grow_array()
  523. 
  524. /* similar to ff_dynarray_add() and av_fast_realloc() */
  525. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  526. {
  527.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:527:9: Taking true branch
  525. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  526. {
  527.     if (new_size >= INT_MAX / elem_size) {
               ^
  528.         fprintf(stderr, "Array too big.\n");
  529.         ffmpeg_exit(1);

ffmpeg.c:528:9: 
  526. {
  527.     if (new_size >= INT_MAX / elem_size) {
  528.         fprintf(stderr, "Array too big.\n");
               ^
  529.         ffmpeg_exit(1);
  530.     }

ffmpeg.c:529:9: Skipping ffmpeg_exit(): empty list of specs
  527.     if (new_size >= INT_MAX / elem_size) {
  528.         fprintf(stderr, "Array too big.\n");
  529.         ffmpeg_exit(1);
               ^
  530.     }
  531.     if (*size < new_size) {

ffmpeg.c:531:9: Taking true branch
  529.         ffmpeg_exit(1);
  530.     }
  531.     if (*size < new_size) {
               ^
  532.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  533.         if (!tmp) {

ffmpeg.c:532:9: 
  530.     }
  531.     if (*size < new_size) {
  532.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  533.         if (!tmp) {
  534.             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:533:14: Taking true branch
  531.     if (*size < new_size) {
  532.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  533.         if (!tmp) {
                    ^
  534.             fprintf(stderr, "Could not alloc buffer.\n");
  535.             ffmpeg_exit(1);

ffmpeg.c:534:13: 
  532.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  533.         if (!tmp) {
  534.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  535.             ffmpeg_exit(1);
  536.         }

ffmpeg.c:535:13: Skipping ffmpeg_exit(): empty list of specs
  533.         if (!tmp) {
  534.             fprintf(stderr, "Could not alloc buffer.\n");
  535.             ffmpeg_exit(1);
                   ^
  536.         }
  537.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:537:9: 
  535.             ffmpeg_exit(1);
  536.         }
  537.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  538.         *size = new_size;
  539.         return tmp;

ffmpeg.c:538:9: 
  536.         }
  537.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  538.         *size = new_size;
               ^
  539.         return tmp;
  540.     }

ffmpeg.c:539:9: 
  537.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  538.         *size = new_size;
  539.         return tmp;
               ^
  540.     }
  541.     return array;

ffmpeg.c:542:1: return from a call to grow_array
  540.     }
  541.     return array;
  542. }
       ^
  543. 
  544. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3098:5: 
3096. 
3097.     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);
3098.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
3099.     return 0;
3100. }
