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

ffmpeg.c:3083:1: start of procedure opt_input_ts_scale()
3081. }
3082. 
3083. static void opt_input_ts_scale(const char *arg)
      ^
3084. {
3085.     unsigned int stream;

ffmpeg.c:3089:5: 
3087.     char *p;
3088. 
3089.     stream = strtol(arg, &p, 0);
          ^
3090.     if (*p)
3091.         p++;

ffmpeg.c:3090:9: Taking true branch
3088. 
3089.     stream = strtol(arg, &p, 0);
3090.     if (*p)
              ^
3091.         p++;
3092.     scale= strtod(p, &p);

ffmpeg.c:3091:9: 
3089.     stream = strtol(arg, &p, 0);
3090.     if (*p)
3091.         p++;
              ^
3092.     scale= strtod(p, &p);
3093. 

ffmpeg.c:3092:5: 
3090.     if (*p)
3091.         p++;
3092.     scale= strtod(p, &p);
          ^
3093. 
3094.     if(stream >= MAX_STREAMS)

ffmpeg.c:3094:8: Taking true branch
3092.     scale= strtod(p, &p);
3093. 
3094.     if(stream >= MAX_STREAMS)
             ^
3095.         ffmpeg_exit(1);
3096. 

ffmpeg.c:3095:9: Skipping ffmpeg_exit(): empty list of specs
3093. 
3094.     if(stream >= MAX_STREAMS)
3095.         ffmpeg_exit(1);
              ^
3096. 
3097.     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:3097:5: 
3095.         ffmpeg_exit(1);
3096. 
3097.     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);
          ^
3098.     input_files_ts_scale[nb_input_files][stream]= scale;
3099. }

ffmpeg.c:663:1: start of procedure grow_array()
  661. 
  662. /* similar to ff_dynarray_add() and av_fast_realloc() */
  663. static void *grow_array(void *array, int elem_size, int *size, int new_size)
       ^
  664. {
  665.     if (new_size >= INT_MAX / elem_size) {

ffmpeg.c:665:9: Taking true branch
  663. static void *grow_array(void *array, int elem_size, int *size, int new_size)
  664. {
  665.     if (new_size >= INT_MAX / elem_size) {
               ^
  666.         fprintf(stderr, "Array too big.\n");
  667.         ffmpeg_exit(1);

ffmpeg.c:666:9: 
  664. {
  665.     if (new_size >= INT_MAX / elem_size) {
  666.         fprintf(stderr, "Array too big.\n");
               ^
  667.         ffmpeg_exit(1);
  668.     }

ffmpeg.c:667:9: Skipping ffmpeg_exit(): empty list of specs
  665.     if (new_size >= INT_MAX / elem_size) {
  666.         fprintf(stderr, "Array too big.\n");
  667.         ffmpeg_exit(1);
               ^
  668.     }
  669.     if (*size < new_size) {

ffmpeg.c:669:9: Taking true branch
  667.         ffmpeg_exit(1);
  668.     }
  669.     if (*size < new_size) {
               ^
  670.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  671.         if (!tmp) {

ffmpeg.c:670:9: 
  668.     }
  669.     if (*size < new_size) {
  670.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
               ^
  671.         if (!tmp) {
  672.             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:671:14: Taking true branch
  669.     if (*size < new_size) {
  670.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  671.         if (!tmp) {
                    ^
  672.             fprintf(stderr, "Could not alloc buffer.\n");
  673.             ffmpeg_exit(1);

ffmpeg.c:672:13: 
  670.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  671.         if (!tmp) {
  672.             fprintf(stderr, "Could not alloc buffer.\n");
                   ^
  673.             ffmpeg_exit(1);
  674.         }

ffmpeg.c:673:13: Skipping ffmpeg_exit(): empty list of specs
  671.         if (!tmp) {
  672.             fprintf(stderr, "Could not alloc buffer.\n");
  673.             ffmpeg_exit(1);
                   ^
  674.         }
  675.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);

ffmpeg.c:675:9: 
  673.             ffmpeg_exit(1);
  674.         }
  675.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  676.         *size = new_size;
  677.         return tmp;

ffmpeg.c:676:9: 
  674.         }
  675.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  676.         *size = new_size;
               ^
  677.         return tmp;
  678.     }

ffmpeg.c:677:9: 
  675.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  676.         *size = new_size;
  677.         return tmp;
               ^
  678.     }
  679.     return array;

ffmpeg.c:680:1: return from a call to grow_array
  678.     }
  679.     return array;
  680. }
       ^
  681. 
  682. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3098:5: 
3096. 
3097.     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);
3098.     input_files_ts_scale[nb_input_files][stream]= scale;
          ^
3099. }
3100. 

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