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

ffmpeg.c:3029:1: start of procedure opt_input_ts_scale()
3027. }
3028. 
3029. static void opt_input_ts_scale(const char *arg)
      ^
3030. {
3031.     unsigned int stream;

ffmpeg.c:3035:5: 
3033.     char *p;
3034. 
3035.     stream = strtol(arg, &p, 0);
          ^
3036.     if (*p)
3037.         p++;

ffmpeg.c:3036:9: Taking true branch
3034. 
3035.     stream = strtol(arg, &p, 0);
3036.     if (*p)
              ^
3037.         p++;
3038.     scale= strtod(p, &p);

ffmpeg.c:3037:9: 
3035.     stream = strtol(arg, &p, 0);
3036.     if (*p)
3037.         p++;
              ^
3038.     scale= strtod(p, &p);
3039. 

ffmpeg.c:3038:5: 
3036.     if (*p)
3037.         p++;
3038.     scale= strtod(p, &p);
          ^
3039. 
3040.     if(stream >= MAX_STREAMS)

ffmpeg.c:3040:8: Taking true branch
3038.     scale= strtod(p, &p);
3039. 
3040.     if(stream >= MAX_STREAMS)
             ^
3041.         ffmpeg_exit(1);
3042. 

ffmpeg.c:3041:9: Skipping ffmpeg_exit(): empty list of specs
3039. 
3040.     if(stream >= MAX_STREAMS)
3041.         ffmpeg_exit(1);
              ^
3042. 
3043.     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:3043:5: 
3041.         ffmpeg_exit(1);
3042. 
3043.     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);
          ^
3044.     input_files_ts_scale[nb_input_files][stream]= scale;
3045. }

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

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

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

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

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

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

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

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

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

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

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

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

ffmpeg.c:3044:5: 
3042. 
3043.     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);
3044.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
3045. }
3046. 
