ffmpeg.c:3082: error: Null Dereference
  pointer `ts_scale` last assigned on line 3081 could be null and is dereferenced at line 3082, column 5.

ffmpeg.c:3070:1: start of procedure opt_input_ts_scale()
3068. }
3069. 
3070. static int opt_input_ts_scale(const char *opt, const char *arg)
      ^
3071. {
3072.     unsigned int stream;

ffmpeg.c:3076:5: 
3074.     char *p;
3075. 
3076.     stream = strtol(arg, &p, 0);
          ^
3077.     if (*p)
3078.         p++;

ffmpeg.c:3077:9: Taking false branch
3075. 
3076.     stream = strtol(arg, &p, 0);
3077.     if (*p)
              ^
3078.         p++;
3079.     scale= strtod(p, &p);

ffmpeg.c:3079:5: 
3077.     if (*p)
3078.         p++;
3079.     scale= strtod(p, &p);
          ^
3080. 
3081.     ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);

ffmpeg.c:3081:5: 
3079.     scale= strtod(p, &p);
3080. 
3081.     ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
          ^
3082.     ts_scale[stream] = scale;
3083.     return 0;

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

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

ffmpeg.c:516:9: 
  514. {
  515.     if (new_size >= INT_MAX / elem_size) {
  516.         fprintf(stderr, "Array too big.\n");
               ^
  517.         ffmpeg_exit(1);
  518.     }

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

ffmpeg.c:519:9: Taking true branch
  517.         ffmpeg_exit(1);
  518.     }
  519.     if (*size < new_size) {
               ^
  520.         uint8_t *tmp = av_realloc(array, new_size*elem_size);
  521.         if (!tmp) {

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

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

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

ffmpeg.c:525:9: 
  523.             ffmpeg_exit(1);
  524.         }
  525.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
               ^
  526.         *size = new_size;
  527.         return tmp;

ffmpeg.c:526:9: 
  524.         }
  525.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  526.         *size = new_size;
               ^
  527.         return tmp;
  528.     }

ffmpeg.c:527:9: 
  525.         memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
  526.         *size = new_size;
  527.         return tmp;
               ^
  528.     }
  529.     return array;

ffmpeg.c:530:1: return from a call to grow_array
  528.     }
  529.     return array;
  530. }
       ^
  531. 
  532. static void choose_sample_fmt(AVStream *st, AVCodec *codec)

ffmpeg.c:3082:5: 
3080. 
3081.     ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
3082.     ts_scale[stream] = scale;
          ^
3083.     return 0;
3084. }
