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

ffmpeg.c:3000:1: start of procedure opt_input_ts_scale()
2998. }
2999. 
3000. static void opt_input_ts_scale(const char *arg)
      ^
3001. {
3002.     unsigned int stream;

ffmpeg.c:3006:5: 
3004.     char *p;
3005. 
3006.     stream = strtol(arg, &p, 0);
          ^
3007.     if (*p)
3008.         p++;

ffmpeg.c:3007:9: Taking true branch
3005. 
3006.     stream = strtol(arg, &p, 0);
3007.     if (*p)
              ^
3008.         p++;
3009.     scale= strtod(p, &p);

ffmpeg.c:3008:9: 
3006.     stream = strtol(arg, &p, 0);
3007.     if (*p)
3008.         p++;
              ^
3009.     scale= strtod(p, &p);
3010. 

ffmpeg.c:3009:5: 
3007.     if (*p)
3008.         p++;
3009.     scale= strtod(p, &p);
          ^
3010. 
3011.     if(stream >= MAX_STREAMS)

ffmpeg.c:3011:8: Taking true branch
3009.     scale= strtod(p, &p);
3010. 
3011.     if(stream >= MAX_STREAMS)
             ^
3012.         ffmpeg_exit(1);
3013. 

ffmpeg.c:3012:9: Skipping ffmpeg_exit(): empty list of specs
3010. 
3011.     if(stream >= MAX_STREAMS)
3012.         ffmpeg_exit(1);
              ^
3013. 
3014.     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:3014:5: 
3012.         ffmpeg_exit(1);
3013. 
3014.     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);
          ^
3015.     input_files_ts_scale[nb_input_files][stream]= scale;
3016. }

ffmpeg.c:503:1: start of procedure grow_array()
  501. 
  502. /* similar to ff_dynarray_add() and av_fast_realloc() */
  503. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  504. {
  505.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:505:9: Taking true branch
  503. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  504. {
  505.     if (new_size >= INT_MAX / elem_size) {
               ^
  506.         fprintf(stderr, "Array too big.\n");
  507.         ffmpeg_exit(1);

ffmpeg.c:506:9: 
  504. {
  505.     if (new_size >= INT_MAX / elem_size) {
  506.         fprintf(stderr, "Array too big.\n");
               ^
  507.         ffmpeg_exit(1);
  508.     }

ffmpeg.c:507:9: Skipping ffmpeg_exit(): empty list of specs
  505.     if (new_size >= INT_MAX / elem_size) {
  506.         fprintf(stderr, "Array too big.\n");
  507.         ffmpeg_exit(1);
               ^
  508.     }
  509.     if (*size < new_size) {

ffmpeg.c:509:9: Taking true branch
  507.         ffmpeg_exit(1);
  508.     }
  509.     if (*size < new_size) {
               ^
  510.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  511.         if (!tmp) {

ffmpeg.c:510:9: 
  508.     }
  509.     if (*size < new_size) {
  510.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  511.         if (!tmp) {
  512.             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:511:14: Taking true branch
  509.     if (*size < new_size) {
  510.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  511.         if (!tmp) {
                    ^
  512.             fprintf(stderr, "Could not alloc buffer.\n");
  513.             ffmpeg_exit(1);

ffmpeg.c:512:13: 
  510.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  511.         if (!tmp) {
  512.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  513.             ffmpeg_exit(1);
  514.         }

ffmpeg.c:513:13: Skipping ffmpeg_exit(): empty list of specs
  511.         if (!tmp) {
  512.             fprintf(stderr, "Could not alloc buffer.\n");
  513.             ffmpeg_exit(1);
                   ^
  514.         }
  515.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:515:9: 
  513.             ffmpeg_exit(1);
  514.         }
  515.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  516.         *size = new_size;
  517.         return tmp;

ffmpeg.c:516:9: 
  514.         }
  515.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  516.         *size = new_size;
               ^
  517.         return tmp;
  518.     }

ffmpeg.c:517:9: 
  515.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  516.         *size = new_size;
  517.         return tmp;
               ^
  518.     }
  519.     return array;

ffmpeg.c:520:1: return from a call to grow_array
  518.     }
  519.     return array;
  520. }
       ^
  521. 
  522. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3015:5: 
3013. 
3014.     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);
3015.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
3016. }
3017. 

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