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

ffmpeg.c:3034:1: start of procedure opt_input_ts_scale()
3032. }
3033. 
3034. static void opt_input_ts_scale(const char *arg)
      ^
3035. {
3036.     unsigned int stream;

ffmpeg.c:3040:5: 
3038.     char *p;
3039. 
3040.     stream = strtol(arg, &p, 0);
          ^
3041.     if (*p)
3042.         p++;

ffmpeg.c:3041:9: Taking true branch
3039. 
3040.     stream = strtol(arg, &p, 0);
3041.     if (*p)
              ^
3042.         p++;
3043.     scale= strtod(p, &p);

ffmpeg.c:3042:9: 
3040.     stream = strtol(arg, &p, 0);
3041.     if (*p)
3042.         p++;
              ^
3043.     scale= strtod(p, &p);
3044. 

ffmpeg.c:3043:5: 
3041.     if (*p)
3042.         p++;
3043.     scale= strtod(p, &p);
          ^
3044. 
3045.     if(stream >= MAX_STREAMS)

ffmpeg.c:3045:8: Taking true branch
3043.     scale= strtod(p, &p);
3044. 
3045.     if(stream >= MAX_STREAMS)
             ^
3046.         ffmpeg_exit(1);
3047. 

ffmpeg.c:3046:9: Skipping ffmpeg_exit(): empty list of specs
3044. 
3045.     if(stream >= MAX_STREAMS)
3046.         ffmpeg_exit(1);
              ^
3047. 
3048.     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:3048:5: 
3046.         ffmpeg_exit(1);
3047. 
3048.     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);
          ^
3049.     input_files_ts_scale[nb_input_files][stream]= scale;
3050. }

ffmpeg.c:520:1: start of procedure grow_array()
  518. 
  519. /* similar to ff_dynarray_add() and av_fast_realloc() */
  520. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  521. {
  522.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:522:9: Taking true branch
  520. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  521. {
  522.     if (new_size >= INT_MAX / elem_size) {
               ^
  523.         fprintf(stderr, "Array too big.\n");
  524.         ffmpeg_exit(1);

ffmpeg.c:523:9: 
  521. {
  522.     if (new_size >= INT_MAX / elem_size) {
  523.         fprintf(stderr, "Array too big.\n");
               ^
  524.         ffmpeg_exit(1);
  525.     }

ffmpeg.c:524:9: Skipping ffmpeg_exit(): empty list of specs
  522.     if (new_size >= INT_MAX / elem_size) {
  523.         fprintf(stderr, "Array too big.\n");
  524.         ffmpeg_exit(1);
               ^
  525.     }
  526.     if (*size < new_size) {

ffmpeg.c:526:9: Taking true branch
  524.         ffmpeg_exit(1);
  525.     }
  526.     if (*size < new_size) {
               ^
  527.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  528.         if (!tmp) {

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

ffmpeg.c:529:13: 
  527.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  528.         if (!tmp) {
  529.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  530.             ffmpeg_exit(1);
  531.         }

ffmpeg.c:530:13: Skipping ffmpeg_exit(): empty list of specs
  528.         if (!tmp) {
  529.             fprintf(stderr, "Could not alloc buffer.\n");
  530.             ffmpeg_exit(1);
                   ^
  531.         }
  532.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:532:9: 
  530.             ffmpeg_exit(1);
  531.         }
  532.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  533.         *size = new_size;
  534.         return tmp;

ffmpeg.c:533:9: 
  531.         }
  532.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  533.         *size = new_size;
               ^
  534.         return tmp;
  535.     }

ffmpeg.c:534:9: 
  532.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  533.         *size = new_size;
  534.         return tmp;
               ^
  535.     }
  536.     return array;

ffmpeg.c:537:1: return from a call to grow_array
  535.     }
  536.     return array;
  537. }
       ^
  538. 
  539. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3049:5: 
3047. 
3048.     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);
3049.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
3050. }
3051. 
