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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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