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

ffmpeg.c:3047:1: start of procedure opt_input_ts_scale()
3045. }
3046. 
3047. static void opt_input_ts_scale(const char *arg)
      ^
3048. {
3049.     unsigned int stream;

ffmpeg.c:3053:5: 
3051.     char *p;
3052. 
3053.     stream = strtol(arg, &p, 0);
          ^
3054.     if (*p)
3055.         p++;

ffmpeg.c:3054:9: Taking true branch
3052. 
3053.     stream = strtol(arg, &p, 0);
3054.     if (*p)
              ^
3055.         p++;
3056.     scale= strtod(p, &p);

ffmpeg.c:3055:9: 
3053.     stream = strtol(arg, &p, 0);
3054.     if (*p)
3055.         p++;
              ^
3056.     scale= strtod(p, &p);
3057. 

ffmpeg.c:3056:5: 
3054.     if (*p)
3055.         p++;
3056.     scale= strtod(p, &p);
          ^
3057. 
3058.     if(stream >= MAX_STREAMS)

ffmpeg.c:3058:8: Taking true branch
3056.     scale= strtod(p, &p);
3057. 
3058.     if(stream >= MAX_STREAMS)
             ^
3059.         ffmpeg_exit(1);
3060. 

ffmpeg.c:3059:9: Skipping ffmpeg_exit(): empty list of specs
3057. 
3058.     if(stream >= MAX_STREAMS)
3059.         ffmpeg_exit(1);
              ^
3060. 
3061.     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:3061:5: 
3059.         ffmpeg_exit(1);
3060. 
3061.     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);
          ^
3062.     input_files_ts_scale[nb_input_files][stream]= scale;
3063. }

ffmpeg.c:561:1: start of procedure grow_array()
  559. 
  560. /* similar to ff_dynarray_add() and av_fast_realloc() */
  561. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  562. {
  563.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:563:9: Taking true branch
  561. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  562. {
  563.     if (new_size >= INT_MAX / elem_size) {
               ^
  564.         fprintf(stderr, "Array too big.\n");
  565.         ffmpeg_exit(1);

ffmpeg.c:564:9: 
  562. {
  563.     if (new_size >= INT_MAX / elem_size) {
  564.         fprintf(stderr, "Array too big.\n");
               ^
  565.         ffmpeg_exit(1);
  566.     }

ffmpeg.c:565:9: Skipping ffmpeg_exit(): empty list of specs
  563.     if (new_size >= INT_MAX / elem_size) {
  564.         fprintf(stderr, "Array too big.\n");
  565.         ffmpeg_exit(1);
               ^
  566.     }
  567.     if (*size < new_size) {

ffmpeg.c:567:9: Taking true branch
  565.         ffmpeg_exit(1);
  566.     }
  567.     if (*size < new_size) {
               ^
  568.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  569.         if (!tmp) {

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

ffmpeg.c:570:13: 
  568.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  569.         if (!tmp) {
  570.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  571.             ffmpeg_exit(1);
  572.         }

ffmpeg.c:571:13: Skipping ffmpeg_exit(): empty list of specs
  569.         if (!tmp) {
  570.             fprintf(stderr, "Could not alloc buffer.\n");
  571.             ffmpeg_exit(1);
                   ^
  572.         }
  573.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:573:9: 
  571.             ffmpeg_exit(1);
  572.         }
  573.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  574.         *size = new_size;
  575.         return tmp;

ffmpeg.c:574:9: 
  572.         }
  573.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  574.         *size = new_size;
               ^
  575.         return tmp;
  576.     }

ffmpeg.c:575:9: 
  573.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  574.         *size = new_size;
  575.         return tmp;
               ^
  576.     }
  577.     return array;

ffmpeg.c:578:1: return from a call to grow_array
  576.     }
  577.     return array;
  578. }
       ^
  579. 
  580. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3062:5: 
3060. 
3061.     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);
3062.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
3063. }
3064. 
