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

ffmpeg.c:2918:1: start of procedure opt_input_ts_scale()
2916. }
2917. 
2918. static void opt_input_ts_scale(const char *arg)
      ^
2919. {
2920.     unsigned int stream;

ffmpeg.c:2924:5: 
2922.     char *p;
2923. 
2924.     stream = strtol(arg, &p, 0);
          ^
2925.     if (*p)
2926.         p++;

ffmpeg.c:2925:9: Taking true branch
2923. 
2924.     stream = strtol(arg, &p, 0);
2925.     if (*p)
              ^
2926.         p++;
2927.     scale= strtod(p, &p);

ffmpeg.c:2926:9: 
2924.     stream = strtol(arg, &p, 0);
2925.     if (*p)
2926.         p++;
              ^
2927.     scale= strtod(p, &p);
2928. 

ffmpeg.c:2927:5: 
2925.     if (*p)
2926.         p++;
2927.     scale= strtod(p, &p);
          ^
2928. 
2929.     if(stream >= MAX_STREAMS)

ffmpeg.c:2929:8: Taking true branch
2927.     scale= strtod(p, &p);
2928. 
2929.     if(stream >= MAX_STREAMS)
             ^
2930.         ffmpeg_exit(1);
2931. 

ffmpeg.c:2930:9: Skipping ffmpeg_exit(): empty list of specs
2928. 
2929.     if(stream >= MAX_STREAMS)
2930.         ffmpeg_exit(1);
              ^
2931. 
2932.     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:2932:5: 
2930.         ffmpeg_exit(1);
2931. 
2932.     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);
          ^
2933.     input_files_ts_scale[nb_input_files][stream]= scale;
2934. }

ffmpeg.c:568:1: start of procedure grow_array()
  566. 
  567. /* similar to ff_dynarray_add() and av_fast_realloc() */
  568. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  569. {
  570.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:570:9: Taking true branch
  568. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  569. {
  570.     if (new_size >= INT_MAX / elem_size) {
               ^
  571.         fprintf(stderr, "Array too big.\n");
  572.         ffmpeg_exit(1);

ffmpeg.c:571:9: 
  569. {
  570.     if (new_size >= INT_MAX / elem_size) {
  571.         fprintf(stderr, "Array too big.\n");
               ^
  572.         ffmpeg_exit(1);
  573.     }

ffmpeg.c:572:9: Skipping ffmpeg_exit(): empty list of specs
  570.     if (new_size >= INT_MAX / elem_size) {
  571.         fprintf(stderr, "Array too big.\n");
  572.         ffmpeg_exit(1);
               ^
  573.     }
  574.     if (*size < new_size) {

ffmpeg.c:574:9: Taking true branch
  572.         ffmpeg_exit(1);
  573.     }
  574.     if (*size < new_size) {
               ^
  575.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  576.         if (!tmp) {

ffmpeg.c:575:9: 
  573.     }
  574.     if (*size < new_size) {
  575.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  576.         if (!tmp) {
  577.             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:576:14: Taking true branch
  574.     if (*size < new_size) {
  575.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  576.         if (!tmp) {
                    ^
  577.             fprintf(stderr, "Could not alloc buffer.\n");
  578.             ffmpeg_exit(1);

ffmpeg.c:577:13: 
  575.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  576.         if (!tmp) {
  577.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  578.             ffmpeg_exit(1);
  579.         }

ffmpeg.c:578:13: Skipping ffmpeg_exit(): empty list of specs
  576.         if (!tmp) {
  577.             fprintf(stderr, "Could not alloc buffer.\n");
  578.             ffmpeg_exit(1);
                   ^
  579.         }
  580.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:580:9: 
  578.             ffmpeg_exit(1);
  579.         }
  580.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  581.         *size = new_size;
  582.         return tmp;

ffmpeg.c:581:9: 
  579.         }
  580.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  581.         *size = new_size;
               ^
  582.         return tmp;
  583.     }

ffmpeg.c:582:9: 
  580.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  581.         *size = new_size;
  582.         return tmp;
               ^
  583.     }
  584.     return array;

ffmpeg.c:585:1: return from a call to grow_array
  583.     }
  584.     return array;
  585. }
       ^
  586. 
  587. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:2933:5: 
2931. 
2932.     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);
2933.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
2934. }
2935. 

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, unsigned int 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}']