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

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

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

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

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

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

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

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

ffmpeg.c:575:1: start of procedure grow_array()
  573. 
  574. /* similar to ff_dynarray_add() and av_fast_realloc() */
  575. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  576. {
  577.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:577:9: Taking true branch
  575. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  576. {
  577.     if (new_size >= INT_MAX / elem_size) {
               ^
  578.         fprintf(stderr, "Array too big.\n");
  579.         ffmpeg_exit(1);

ffmpeg.c:578:9: 
  576. {
  577.     if (new_size >= INT_MAX / elem_size) {
  578.         fprintf(stderr, "Array too big.\n");
               ^
  579.         ffmpeg_exit(1);
  580.     }

ffmpeg.c:579:9: Skipping ffmpeg_exit(): empty list of specs
  577.     if (new_size >= INT_MAX / elem_size) {
  578.         fprintf(stderr, "Array too big.\n");
  579.         ffmpeg_exit(1);
               ^
  580.     }
  581.     if (*size < new_size) {

ffmpeg.c:581:9: Taking true branch
  579.         ffmpeg_exit(1);
  580.     }
  581.     if (*size < new_size) {
               ^
  582.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  583.         if (!tmp) {

ffmpeg.c:582:9: 
  580.     }
  581.     if (*size < new_size) {
  582.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  583.         if (!tmp) {
  584.             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:583:14: Taking true branch
  581.     if (*size < new_size) {
  582.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  583.         if (!tmp) {
                    ^
  584.             fprintf(stderr, "Could not alloc buffer.\n");
  585.             ffmpeg_exit(1);

ffmpeg.c:584:13: 
  582.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  583.         if (!tmp) {
  584.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  585.             ffmpeg_exit(1);
  586.         }

ffmpeg.c:585:13: Skipping ffmpeg_exit(): empty list of specs
  583.         if (!tmp) {
  584.             fprintf(stderr, "Could not alloc buffer.\n");
  585.             ffmpeg_exit(1);
                   ^
  586.         }
  587.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:587:9: 
  585.             ffmpeg_exit(1);
  586.         }
  587.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  588.         *size = new_size;
  589.         return tmp;

ffmpeg.c:588:9: 
  586.         }
  587.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  588.         *size = new_size;
               ^
  589.         return tmp;
  590.     }

ffmpeg.c:589:9: 
  587.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  588.         *size = new_size;
  589.         return tmp;
               ^
  590.     }
  591.     return array;

ffmpeg.c:592:1: return from a call to grow_array
  590.     }
  591.     return array;
  592. }
       ^
  593. 
  594. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

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