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

ffmpeg.c:3017:1: start of procedure opt_input_ts_scale()
3015. }
3016. 
3017. static void opt_input_ts_scale(const char *arg)
      ^
3018. {
3019.     unsigned int stream;

ffmpeg.c:3023:5: 
3021.     char *p;
3022. 
3023.     stream = strtol(arg, &p, 0);
          ^
3024.     if (*p)
3025.         p++;

ffmpeg.c:3024:9: Taking true branch
3022. 
3023.     stream = strtol(arg, &p, 0);
3024.     if (*p)
              ^
3025.         p++;
3026.     scale= strtod(p, &p);

ffmpeg.c:3025:9: 
3023.     stream = strtol(arg, &p, 0);
3024.     if (*p)
3025.         p++;
              ^
3026.     scale= strtod(p, &p);
3027. 

ffmpeg.c:3026:5: 
3024.     if (*p)
3025.         p++;
3026.     scale= strtod(p, &p);
          ^
3027. 
3028.     if(stream >= MAX_STREAMS)

ffmpeg.c:3028:8: Taking true branch
3026.     scale= strtod(p, &p);
3027. 
3028.     if(stream >= MAX_STREAMS)
             ^
3029.         ffmpeg_exit(1);
3030. 

ffmpeg.c:3029:9: Skipping ffmpeg_exit(): empty list of specs
3027. 
3028.     if(stream >= MAX_STREAMS)
3029.         ffmpeg_exit(1);
              ^
3030. 
3031.     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:3031:5: 
3029.         ffmpeg_exit(1);
3030. 
3031.     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);
          ^
3032.     input_files_ts_scale[nb_input_files][stream]= scale;
3033. }

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

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

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

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

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

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

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

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

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

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

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

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

ffmpeg.c:3032:5: 
3030. 
3031.     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);
3032.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
3033. }
3034. 
