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

ffmpeg.c:3075:1: start of procedure opt_input_ts_scale()
3073. }
3074. 
3075. static void opt_input_ts_scale(const char *arg)
      ^
3076. {
3077.     unsigned int stream;

ffmpeg.c:3081:5: 
3079.     char *p;
3080. 
3081.     stream = strtol(arg, &p, 0);
          ^
3082.     if (*p)
3083.         p++;

ffmpeg.c:3082:9: Taking true branch
3080. 
3081.     stream = strtol(arg, &p, 0);
3082.     if (*p)
              ^
3083.         p++;
3084.     scale= strtod(p, &p);

ffmpeg.c:3083:9: 
3081.     stream = strtol(arg, &p, 0);
3082.     if (*p)
3083.         p++;
              ^
3084.     scale= strtod(p, &p);
3085. 

ffmpeg.c:3084:5: 
3082.     if (*p)
3083.         p++;
3084.     scale= strtod(p, &p);
          ^
3085. 
3086.     if(stream >= MAX_STREAMS)

ffmpeg.c:3086:8: Taking true branch
3084.     scale= strtod(p, &p);
3085. 
3086.     if(stream >= MAX_STREAMS)
             ^
3087.         ffmpeg_exit(1);
3088. 

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

ffmpeg.c:662:1: start of procedure grow_array()
  660. 
  661. /* similar to ff_dynarray_add() and av_fast_realloc() */
  662. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  663. {
  664.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:664:9: Taking true branch
  662. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  663. {
  664.     if (new_size >= INT_MAX / elem_size) {
               ^
  665.         fprintf(stderr, "Array too big.\n");
  666.         ffmpeg_exit(1);

ffmpeg.c:665:9: 
  663. {
  664.     if (new_size >= INT_MAX / elem_size) {
  665.         fprintf(stderr, "Array too big.\n");
               ^
  666.         ffmpeg_exit(1);
  667.     }

ffmpeg.c:666:9: Skipping ffmpeg_exit(): empty list of specs
  664.     if (new_size >= INT_MAX / elem_size) {
  665.         fprintf(stderr, "Array too big.\n");
  666.         ffmpeg_exit(1);
               ^
  667.     }
  668.     if (*size < new_size) {

ffmpeg.c:668:9: Taking true branch
  666.         ffmpeg_exit(1);
  667.     }
  668.     if (*size < new_size) {
               ^
  669.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  670.         if (!tmp) {

ffmpeg.c:669:9: 
  667.     }
  668.     if (*size < new_size) {
  669.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  670.         if (!tmp) {
  671.             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:670:14: Taking true branch
  668.     if (*size < new_size) {
  669.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  670.         if (!tmp) {
                    ^
  671.             fprintf(stderr, "Could not alloc buffer.\n");
  672.             ffmpeg_exit(1);

ffmpeg.c:671:13: 
  669.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  670.         if (!tmp) {
  671.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  672.             ffmpeg_exit(1);
  673.         }

ffmpeg.c:672:13: Skipping ffmpeg_exit(): empty list of specs
  670.         if (!tmp) {
  671.             fprintf(stderr, "Could not alloc buffer.\n");
  672.             ffmpeg_exit(1);
                   ^
  673.         }
  674.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:674:9: 
  672.             ffmpeg_exit(1);
  673.         }
  674.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  675.         *size = new_size;
  676.         return tmp;

ffmpeg.c:675:9: 
  673.         }
  674.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  675.         *size = new_size;
               ^
  676.         return tmp;
  677.     }

ffmpeg.c:676:9: 
  674.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  675.         *size = new_size;
  676.         return tmp;
               ^
  677.     }
  678.     return array;

ffmpeg.c:679:1: return from a call to grow_array
  677.     }
  678.     return array;
  679. }
       ^
  680. 
  681. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3090:5: 
3088. 
3089.     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);
3090.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
3091. }
3092. 
