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

ffmpeg.c:3035:1: start of procedure opt_input_ts_scale()
3033. }
3034. 
3035. static void opt_input_ts_scale(const char *arg)
      ^
3036. {
3037.     unsigned int stream;

ffmpeg.c:3041:5: 
3039.     char *p;
3040. 
3041.     stream = strtol(arg, &p, 0);
          ^
3042.     if (*p)
3043.         p++;

ffmpeg.c:3042:9: Taking false branch
3040. 
3041.     stream = strtol(arg, &p, 0);
3042.     if (*p)
              ^
3043.         p++;
3044.     scale= strtod(p, &p);

ffmpeg.c:3044:5: 
3042.     if (*p)
3043.         p++;
3044.     scale= strtod(p, &p);
          ^
3045. 
3046.     if(stream >= MAX_STREAMS)

ffmpeg.c:3046:8: Taking true branch
3044.     scale= strtod(p, &p);
3045. 
3046.     if(stream >= MAX_STREAMS)
             ^
3047.         ffmpeg_exit(1);
3048. 

ffmpeg.c:3047:9: Skipping ffmpeg_exit(): empty list of specs
3045. 
3046.     if(stream >= MAX_STREAMS)
3047.         ffmpeg_exit(1);
              ^
3048. 
3049.     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:3049:5: 
3047.         ffmpeg_exit(1);
3048. 
3049.     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);
          ^
3050.     input_files_ts_scale[nb_input_files][stream]= scale;
3051. }

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

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

ffmpeg.c:527:9: 
  525. {
  526.     if (new_size >= INT_MAX / elem_size) {
  527.         fprintf(stderr, "Array too big.\n");
               ^
  528.         ffmpeg_exit(1);
  529.     }

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

ffmpeg.c:530:9: Taking true branch
  528.         ffmpeg_exit(1);
  529.     }
  530.     if (*size < new_size) {
               ^
  531.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  532.         if (!tmp) {

ffmpeg.c:531:9: 
  529.     }
  530.     if (*size < new_size) {
  531.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  532.         if (!tmp) {
  533.             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 true branch
    122. 
    123.     /* let's disallow possible ambiguous cases */
    124.     if(size > (INT_MAX-16) )
                ^
    125.         return NULL;
    126. 

libavutil/mem.c:125:9: 
    123.     /* let's disallow possible ambiguous cases */
    124.     if(size > (INT_MAX-16) )
    125.         return NULL;
                 ^
    126. 
    127. #if CONFIG_MEMALIGN_HACK

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:532:14: Taking true branch
  530.     if (*size < new_size) {
  531.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  532.         if (!tmp) {
                    ^
  533.             fprintf(stderr, "Could not alloc buffer.\n");
  534.             ffmpeg_exit(1);

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

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

ffmpeg.c:536:9: 
  534.             ffmpeg_exit(1);
  535.         }
  536.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  537.         *size = new_size;
  538.         return tmp;

ffmpeg.c:537:9: 
  535.         }
  536.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  537.         *size = new_size;
               ^
  538.         return tmp;
  539.     }

ffmpeg.c:538:9: 
  536.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  537.         *size = new_size;
  538.         return tmp;
               ^
  539.     }
  540.     return array;

ffmpeg.c:541:1: return from a call to grow_array
  539.     }
  540.     return array;
  541. }
       ^
  542. 
  543. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3050:5: 
3048. 
3049.     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);
3050.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
3051. }
3052. 

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