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

ffmpeg.c:3005:1: start of procedure opt_input_ts_scale()
3003. }
3004. 
3005. static void opt_input_ts_scale(const char *arg)
      ^
3006. {
3007.     unsigned int stream;

ffmpeg.c:3011:5: 
3009.     char *p;
3010. 
3011.     stream = strtol(arg, &p, 0);
          ^
3012.     if (*p)
3013.         p++;

ffmpeg.c:3012:9: Taking true branch
3010. 
3011.     stream = strtol(arg, &p, 0);
3012.     if (*p)
              ^
3013.         p++;
3014.     scale= strtod(p, &p);

ffmpeg.c:3013:9: 
3011.     stream = strtol(arg, &p, 0);
3012.     if (*p)
3013.         p++;
              ^
3014.     scale= strtod(p, &p);
3015. 

ffmpeg.c:3014:5: 
3012.     if (*p)
3013.         p++;
3014.     scale= strtod(p, &p);
          ^
3015. 
3016.     if(stream >= MAX_STREAMS)

ffmpeg.c:3016:8: Taking true branch
3014.     scale= strtod(p, &p);
3015. 
3016.     if(stream >= MAX_STREAMS)
             ^
3017.         ffmpeg_exit(1);
3018. 

ffmpeg.c:3017:9: Skipping ffmpeg_exit(): empty list of specs
3015. 
3016.     if(stream >= MAX_STREAMS)
3017.         ffmpeg_exit(1);
              ^
3018. 
3019.     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:3019:5: 
3017.         ffmpeg_exit(1);
3018. 
3019.     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);
          ^
3020.     input_files_ts_scale[nb_input_files][stream]= scale;
3021. }

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

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

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

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

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

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

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

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

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

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

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

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

ffmpeg.c:3020:5: 
3018. 
3019.     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);
3020.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
3021. }
3022. 

static void opt_input_ts_scale(const char *arg)
{
    unsigned int stream;
    double scale;
    char *p;
    stream = strtol(arg, &p, 0);
    if (*p)
        p++;
    scale= strtod(p, &p);
    if(stream >= MAX_STREAMS)
        ffmpeg_exit(1);
    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);
    input_files_ts_scale[nb_input_files][stream]= scale;
}
['static void opt_input_ts_scale(const char *arg)\n{\n    unsigned int stream;\n    double scale;\n    char *p;\n    stream = strtol(arg, &p, 0);\n    if (*p)\n        p++;\n    scale= strtod(p, &p);\n    if(stream >= MAX_STREAMS)\n        ffmpeg_exit(1);\n    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);\n    input_files_ts_scale[nb_input_files][stream]= scale;\n}', 'static void *grow_array(void *array, int elem_size, int *size, int new_size)\n{\n    if (new_size >= INT_MAX / elem_size) {\n        fprintf(stderr, "Array too big.\\n");\n        ffmpeg_exit(1);\n    }\n    if (*size < new_size) {\n        uint8_t *tmp = av_realloc(array, new_size*elem_size);\n        if (!tmp) {\n            fprintf(stderr, "Could not alloc buffer.\\n");\n            ffmpeg_exit(1);\n        }\n        memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);\n        *size = new_size;\n        return tmp;\n    }\n    return array;\n}', 'void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)\n{\n#if CONFIG_MEMALIGN_HACK\n    int diff;\n#endif\n    if(size > (INT_MAX-16) )\n        return NULL;\n#if CONFIG_MEMALIGN_HACK\n    if(!ptr) return av_malloc(size);\n    diff= ((char*)ptr)[-1];\n    return (char*)realloc((char*)ptr - diff, size + diff) + diff;\n#else\n    return realloc(ptr, size);\n#endif\n}']