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

ffmpeg.c:3021:1: start of procedure opt_input_ts_scale()
3019. }
3020. 
3021. static void opt_input_ts_scale(const char *arg)
      ^
3022. {
3023.     unsigned int stream;

ffmpeg.c:3027:5: 
3025.     char *p;
3026. 
3027.     stream = strtol(arg, &p, 0);
          ^
3028.     if (*p)
3029.         p++;

ffmpeg.c:3028:9: Taking true branch
3026. 
3027.     stream = strtol(arg, &p, 0);
3028.     if (*p)
              ^
3029.         p++;
3030.     scale= strtod(p, &p);

ffmpeg.c:3029:9: 
3027.     stream = strtol(arg, &p, 0);
3028.     if (*p)
3029.         p++;
              ^
3030.     scale= strtod(p, &p);
3031. 

ffmpeg.c:3030:5: 
3028.     if (*p)
3029.         p++;
3030.     scale= strtod(p, &p);
          ^
3031. 
3032.     if(stream >= MAX_STREAMS)

ffmpeg.c:3032:8: Taking true branch
3030.     scale= strtod(p, &p);
3031. 
3032.     if(stream >= MAX_STREAMS)
             ^
3033.         ffmpeg_exit(1);
3034. 

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

ffmpeg.c:578:1: start of procedure grow_array()
  576. 
  577. /* similar to ff_dynarray_add() and av_fast_realloc() */
  578. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  579. {
  580.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:580:9: Taking true branch
  578. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  579. {
  580.     if (new_size >= INT_MAX / elem_size) {
               ^
  581.         fprintf(stderr, "Array too big.\n");
  582.         ffmpeg_exit(1);

ffmpeg.c:581:9: 
  579. {
  580.     if (new_size >= INT_MAX / elem_size) {
  581.         fprintf(stderr, "Array too big.\n");
               ^
  582.         ffmpeg_exit(1);
  583.     }

ffmpeg.c:582:9: Skipping ffmpeg_exit(): empty list of specs
  580.     if (new_size >= INT_MAX / elem_size) {
  581.         fprintf(stderr, "Array too big.\n");
  582.         ffmpeg_exit(1);
               ^
  583.     }
  584.     if (*size < new_size) {

ffmpeg.c:584:9: Taking true branch
  582.         ffmpeg_exit(1);
  583.     }
  584.     if (*size < new_size) {
               ^
  585.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  586.         if (!tmp) {

ffmpeg.c:585:9: 
  583.     }
  584.     if (*size < new_size) {
  585.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  586.         if (!tmp) {
  587.             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 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:586:14: Taking true branch
  584.     if (*size < new_size) {
  585.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  586.         if (!tmp) {
                    ^
  587.             fprintf(stderr, "Could not alloc buffer.\n");
  588.             ffmpeg_exit(1);

ffmpeg.c:587:13: 
  585.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  586.         if (!tmp) {
  587.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  588.             ffmpeg_exit(1);
  589.         }

ffmpeg.c:588:13: Skipping ffmpeg_exit(): empty list of specs
  586.         if (!tmp) {
  587.             fprintf(stderr, "Could not alloc buffer.\n");
  588.             ffmpeg_exit(1);
                   ^
  589.         }
  590.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:590:9: 
  588.             ffmpeg_exit(1);
  589.         }
  590.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  591.         *size = new_size;
  592.         return tmp;

ffmpeg.c:591:9: 
  589.         }
  590.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  591.         *size = new_size;
               ^
  592.         return tmp;
  593.     }

ffmpeg.c:592:9: 
  590.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  591.         *size = new_size;
  592.         return tmp;
               ^
  593.     }
  594.     return array;

ffmpeg.c:595:1: return from a call to grow_array
  593.     }
  594.     return array;
  595. }
       ^
  596. 
  597. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3036:5: 
3034. 
3035.     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);
3036.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
3037. }
3038. 
