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

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

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

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

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

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

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

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

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

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

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

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

ffmpeg.c:524:9: 
  522.     }
  523.     if (*size < new_size) {
  524.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  525.         if (!tmp) {
  526.             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:525:14: Taking true branch
  523.     if (*size < new_size) {
  524.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  525.         if (!tmp) {
                    ^
  526.             fprintf(stderr, "Could not alloc buffer.\n");
  527.             ffmpeg_exit(1);

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

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

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

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

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

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

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

static int opt_input_ts_scale(const char *opt, 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;
    return 0;
}
['static int opt_input_ts_scale(const char *opt, 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    return 0;\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, size_t 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}']