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

ffmpeg.c:3040:1: start of procedure opt_input_ts_scale()
3038. }
3039. 
3040. static void opt_input_ts_scale(const char *arg)
      ^
3041. {
3042.     unsigned int stream;

ffmpeg.c:3046:5: 
3044.     char *p;
3045. 
3046.     stream = strtol(arg, &p, 0);
          ^
3047.     if (*p)
3048.         p++;

ffmpeg.c:3047:9: Taking false branch
3045. 
3046.     stream = strtol(arg, &p, 0);
3047.     if (*p)
              ^
3048.         p++;
3049.     scale= strtod(p, &p);

ffmpeg.c:3049:5: 
3047.     if (*p)
3048.         p++;
3049.     scale= strtod(p, &p);
          ^
3050. 
3051.     if(stream >= MAX_STREAMS)

ffmpeg.c:3051:8: Taking true branch
3049.     scale= strtod(p, &p);
3050. 
3051.     if(stream >= MAX_STREAMS)
             ^
3052.         ffmpeg_exit(1);
3053. 

ffmpeg.c:3052:9: Skipping ffmpeg_exit(): empty list of specs
3050. 
3051.     if(stream >= MAX_STREAMS)
3052.         ffmpeg_exit(1);
              ^
3053. 
3054.     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:3054:5: 
3052.         ffmpeg_exit(1);
3053. 
3054.     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);
          ^
3055.     input_files_ts_scale[nb_input_files][stream]= scale;
3056. }

ffmpeg.c:620:1: start of procedure grow_array()
  618. 
  619. /* similar to ff_dynarray_add() and av_fast_realloc() */
  620. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  621. {
  622.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:622:9: Taking true branch
  620. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  621. {
  622.     if (new_size >= INT_MAX / elem_size) {
               ^
  623.         fprintf(stderr, "Array too big.\n");
  624.         ffmpeg_exit(1);

ffmpeg.c:623:9: 
  621. {
  622.     if (new_size >= INT_MAX / elem_size) {
  623.         fprintf(stderr, "Array too big.\n");
               ^
  624.         ffmpeg_exit(1);
  625.     }

ffmpeg.c:624:9: Skipping ffmpeg_exit(): empty list of specs
  622.     if (new_size >= INT_MAX / elem_size) {
  623.         fprintf(stderr, "Array too big.\n");
  624.         ffmpeg_exit(1);
               ^
  625.     }
  626.     if (*size < new_size) {

ffmpeg.c:626:9: Taking true branch
  624.         ffmpeg_exit(1);
  625.     }
  626.     if (*size < new_size) {
               ^
  627.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  628.         if (!tmp) {

ffmpeg.c:627:9: 
  625.     }
  626.     if (*size < new_size) {
  627.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  628.         if (!tmp) {
  629.             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 true branch
    124. 
    125.     /* let's disallow possible ambiguous cases */
    126.     if(size > (INT_MAX-16) )
                ^
    127.         return NULL;
    128. 

libavutil/mem.c:127:9: 
    125.     /* let's disallow possible ambiguous cases */
    126.     if(size > (INT_MAX-16) )
    127.         return NULL;
                 ^
    128. 
    129. #if CONFIG_MEMALIGN_HACK

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:628:14: Taking true branch
  626.     if (*size < new_size) {
  627.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  628.         if (!tmp) {
                    ^
  629.             fprintf(stderr, "Could not alloc buffer.\n");
  630.             ffmpeg_exit(1);

ffmpeg.c:629:13: 
  627.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  628.         if (!tmp) {
  629.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  630.             ffmpeg_exit(1);
  631.         }

ffmpeg.c:630:13: Skipping ffmpeg_exit(): empty list of specs
  628.         if (!tmp) {
  629.             fprintf(stderr, "Could not alloc buffer.\n");
  630.             ffmpeg_exit(1);
                   ^
  631.         }
  632.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:632:9: 
  630.             ffmpeg_exit(1);
  631.         }
  632.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  633.         *size = new_size;
  634.         return tmp;

ffmpeg.c:633:9: 
  631.         }
  632.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  633.         *size = new_size;
               ^
  634.         return tmp;
  635.     }

ffmpeg.c:634:9: 
  632.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  633.         *size = new_size;
  634.         return tmp;
               ^
  635.     }
  636.     return array;

ffmpeg.c:637:1: return from a call to grow_array
  635.     }
  636.     return array;
  637. }
       ^
  638. 
  639. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3055:5: 
3053. 
3054.     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);
3055.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
3056. }
3057. 
