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

ffmpeg.c:3027:1: start of procedure opt_input_ts_scale()
3025. }
3026. 
3027. static void opt_input_ts_scale(const char *arg)
      ^
3028. {
3029.     unsigned int stream;

ffmpeg.c:3033:5: 
3031.     char *p;
3032. 
3033.     stream = strtol(arg, &p, 0);
          ^
3034.     if (*p)
3035.         p++;

ffmpeg.c:3034:9: Taking true branch
3032. 
3033.     stream = strtol(arg, &p, 0);
3034.     if (*p)
              ^
3035.         p++;
3036.     scale= strtod(p, &p);

ffmpeg.c:3035:9: 
3033.     stream = strtol(arg, &p, 0);
3034.     if (*p)
3035.         p++;
              ^
3036.     scale= strtod(p, &p);
3037. 

ffmpeg.c:3036:5: 
3034.     if (*p)
3035.         p++;
3036.     scale= strtod(p, &p);
          ^
3037. 
3038.     if(stream >= MAX_STREAMS)

ffmpeg.c:3038:8: Taking true branch
3036.     scale= strtod(p, &p);
3037. 
3038.     if(stream >= MAX_STREAMS)
             ^
3039.         ffmpeg_exit(1);
3040. 

ffmpeg.c:3039:9: Skipping ffmpeg_exit(): empty list of specs
3037. 
3038.     if(stream >= MAX_STREAMS)
3039.         ffmpeg_exit(1);
              ^
3040. 
3041.     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:3041:5: 
3039.         ffmpeg_exit(1);
3040. 
3041.     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);
          ^
3042.     input_files_ts_scale[nb_input_files][stream]= scale;
3043. }

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

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

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

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

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

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

libavutil/mem.c:117:1: start of procedure av_realloc()
    115. }
    116. 
    117. void *av_realloc(void *ptr, size_t size)
         ^
    118. {
    119. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:124:8: Taking false branch
    122. 
    123.     /* let's disallow possible ambiguous cases */
    124.     if(size > (INT_MAX-16) )
                ^
    125.         return NULL;
    126. 

libavutil/mem.c:133:5: 
    131.     return (char*)realloc((char*)ptr - diff, size + diff) + diff;
    132. #else
    133.     return realloc(ptr, size);
             ^
    134. #endif
    135. }

libavutil/mem.c:135:1: return from a call to av_realloc
    133.     return realloc(ptr, size);
    134. #endif
    135. }
         ^
    136. 
    137. void av_free(void *ptr)

ffmpeg.c:528:14: Taking true branch
  526.     if (*size < new_size) {
  527.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  528.         if (!tmp) {
                    ^
  529.             fprintf(stderr, "Could not alloc buffer.\n");
  530.             ffmpeg_exit(1);

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

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

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

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

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

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

ffmpeg.c:3042:5: 
3040. 
3041.     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);
3042.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
3043. }
3044. 
