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

ffmpeg.c:3042:1: start of procedure opt_input_ts_scale()
3040. }
3041. 
3042. static void opt_input_ts_scale(const char *arg)
      ^
3043. {
3044.     unsigned int stream;

ffmpeg.c:3048:5: 
3046.     char *p;
3047. 
3048.     stream = strtol(arg, &p, 0);
          ^
3049.     if (*p)
3050.         p++;

ffmpeg.c:3049:9: Taking true branch
3047. 
3048.     stream = strtol(arg, &p, 0);
3049.     if (*p)
              ^
3050.         p++;
3051.     scale= strtod(p, &p);

ffmpeg.c:3050:9: 
3048.     stream = strtol(arg, &p, 0);
3049.     if (*p)
3050.         p++;
              ^
3051.     scale= strtod(p, &p);
3052. 

ffmpeg.c:3051:5: 
3049.     if (*p)
3050.         p++;
3051.     scale= strtod(p, &p);
          ^
3052. 
3053.     if(stream >= MAX_STREAMS)

ffmpeg.c:3053:8: Taking true branch
3051.     scale= strtod(p, &p);
3052. 
3053.     if(stream >= MAX_STREAMS)
             ^
3054.         ffmpeg_exit(1);
3055. 

ffmpeg.c:3054:9: Skipping ffmpeg_exit(): empty list of specs
3052. 
3053.     if(stream >= MAX_STREAMS)
3054.         ffmpeg_exit(1);
              ^
3055. 
3056.     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:3056:5: 
3054.         ffmpeg_exit(1);
3055. 
3056.     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);
          ^
3057.     input_files_ts_scale[nb_input_files][stream]= scale;
3058. }

ffmpeg.c:561:1: start of procedure grow_array()
  559. 
  560. /* similar to ff_dynarray_add() and av_fast_realloc() */
  561. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  562. {
  563.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:563:9: Taking true branch
  561. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  562. {
  563.     if (new_size >= INT_MAX / elem_size) {
               ^
  564.         fprintf(stderr, "Array too big.\n");
  565.         ffmpeg_exit(1);

ffmpeg.c:564:9: 
  562. {
  563.     if (new_size >= INT_MAX / elem_size) {
  564.         fprintf(stderr, "Array too big.\n");
               ^
  565.         ffmpeg_exit(1);
  566.     }

ffmpeg.c:565:9: Skipping ffmpeg_exit(): empty list of specs
  563.     if (new_size >= INT_MAX / elem_size) {
  564.         fprintf(stderr, "Array too big.\n");
  565.         ffmpeg_exit(1);
               ^
  566.     }
  567.     if (*size < new_size) {

ffmpeg.c:567:9: Taking true branch
  565.         ffmpeg_exit(1);
  566.     }
  567.     if (*size < new_size) {
               ^
  568.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  569.         if (!tmp) {

ffmpeg.c:568:9: 
  566.     }
  567.     if (*size < new_size) {
  568.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  569.         if (!tmp) {
  570.             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:569:14: Taking true branch
  567.     if (*size < new_size) {
  568.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  569.         if (!tmp) {
                    ^
  570.             fprintf(stderr, "Could not alloc buffer.\n");
  571.             ffmpeg_exit(1);

ffmpeg.c:570:13: 
  568.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  569.         if (!tmp) {
  570.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  571.             ffmpeg_exit(1);
  572.         }

ffmpeg.c:571:13: Skipping ffmpeg_exit(): empty list of specs
  569.         if (!tmp) {
  570.             fprintf(stderr, "Could not alloc buffer.\n");
  571.             ffmpeg_exit(1);
                   ^
  572.         }
  573.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:573:9: 
  571.             ffmpeg_exit(1);
  572.         }
  573.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  574.         *size = new_size;
  575.         return tmp;

ffmpeg.c:574:9: 
  572.         }
  573.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  574.         *size = new_size;
               ^
  575.         return tmp;
  576.     }

ffmpeg.c:575:9: 
  573.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  574.         *size = new_size;
  575.         return tmp;
               ^
  576.     }
  577.     return array;

ffmpeg.c:578:1: return from a call to grow_array
  576.     }
  577.     return array;
  578. }
       ^
  579. 
  580. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3057:5: 
3055. 
3056.     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);
3057.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
3058. }
3059. 
