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

ffmpeg.c:2994:1: start of procedure opt_input_ts_scale()
2992. }
2993. 
2994. static void opt_input_ts_scale(const char *arg)
      ^
2995. {
2996.     unsigned int stream;

ffmpeg.c:3000:5: 
2998.     char *p;
2999. 
3000.     stream = strtol(arg, &p, 0);
          ^
3001.     if (*p)
3002.         p++;

ffmpeg.c:3001:9: Taking true branch
2999. 
3000.     stream = strtol(arg, &p, 0);
3001.     if (*p)
              ^
3002.         p++;
3003.     scale= strtod(p, &p);

ffmpeg.c:3002:9: 
3000.     stream = strtol(arg, &p, 0);
3001.     if (*p)
3002.         p++;
              ^
3003.     scale= strtod(p, &p);
3004. 

ffmpeg.c:3003:5: 
3001.     if (*p)
3002.         p++;
3003.     scale= strtod(p, &p);
          ^
3004. 
3005.     if(stream >= MAX_STREAMS)

ffmpeg.c:3005:8: Taking true branch
3003.     scale= strtod(p, &p);
3004. 
3005.     if(stream >= MAX_STREAMS)
             ^
3006.         ffmpeg_exit(1);
3007. 

ffmpeg.c:3006:9: Skipping ffmpeg_exit(): empty list of specs
3004. 
3005.     if(stream >= MAX_STREAMS)
3006.         ffmpeg_exit(1);
              ^
3007. 
3008.     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:3008:5: 
3006.         ffmpeg_exit(1);
3007. 
3008.     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);
          ^
3009.     input_files_ts_scale[nb_input_files][stream]= scale;
3010. }

ffmpeg.c:508:1: start of procedure grow_array()
  506. 
  507. /* similar to ff_dynarray_add() and av_fast_realloc() */
  508. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  509. {
  510.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:510:9: Taking true branch
  508. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  509. {
  510.     if (new_size >= INT_MAX / elem_size) {
               ^
  511.         fprintf(stderr, "Array too big.\n");
  512.         ffmpeg_exit(1);

ffmpeg.c:511:9: 
  509. {
  510.     if (new_size >= INT_MAX / elem_size) {
  511.         fprintf(stderr, "Array too big.\n");
               ^
  512.         ffmpeg_exit(1);
  513.     }

ffmpeg.c:512:9: Skipping ffmpeg_exit(): empty list of specs
  510.     if (new_size >= INT_MAX / elem_size) {
  511.         fprintf(stderr, "Array too big.\n");
  512.         ffmpeg_exit(1);
               ^
  513.     }
  514.     if (*size < new_size) {

ffmpeg.c:514:9: Taking true branch
  512.         ffmpeg_exit(1);
  513.     }
  514.     if (*size < new_size) {
               ^
  515.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  516.         if (!tmp) {

ffmpeg.c:515:9: 
  513.     }
  514.     if (*size < new_size) {
  515.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  516.         if (!tmp) {
  517.             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:516:14: Taking true branch
  514.     if (*size < new_size) {
  515.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  516.         if (!tmp) {
                    ^
  517.             fprintf(stderr, "Could not alloc buffer.\n");
  518.             ffmpeg_exit(1);

ffmpeg.c:517:13: 
  515.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  516.         if (!tmp) {
  517.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  518.             ffmpeg_exit(1);
  519.         }

ffmpeg.c:518:13: Skipping ffmpeg_exit(): empty list of specs
  516.         if (!tmp) {
  517.             fprintf(stderr, "Could not alloc buffer.\n");
  518.             ffmpeg_exit(1);
                   ^
  519.         }
  520.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:520:9: 
  518.             ffmpeg_exit(1);
  519.         }
  520.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  521.         *size = new_size;
  522.         return tmp;

ffmpeg.c:521:9: 
  519.         }
  520.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  521.         *size = new_size;
               ^
  522.         return tmp;
  523.     }

ffmpeg.c:522:9: 
  520.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  521.         *size = new_size;
  522.         return tmp;
               ^
  523.     }
  524.     return array;

ffmpeg.c:525:1: return from a call to grow_array
  523.     }
  524.     return array;
  525. }
       ^
  526. 
  527. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3009:5: 
3007. 
3008.     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);
3009.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
3010. }
3011. 
